Skip to content

Commit d20a794

Browse files
authored
Add WHOX (#482)
1 parent 2dce133 commit d20a794

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

extensions/whox.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: WHOX
3+
layout: spec
4+
copyrights:
5+
-
6+
name: "Simon Ser"
7+
period: "2021"
8+
9+
---
10+
11+
## Introduction
12+
13+
The WHOX extension allows clients to request additional fields in the `WHO`
14+
response (e.g. account name) or omit default fields (e.g. username and
15+
hostname).
16+
17+
## `ISUPPORT` token
18+
19+
Servers supporting this specification MUST include the `WHOX` token in
20+
`RPL_ISUPPORT` without any value. Clients MUST accept `WHOX` tokens with a
21+
value for forwards compatibility.
22+
23+
## Extended `WHO` command
24+
25+
The `WHO` command is extended with an optional argument:
26+
27+
WHO <mask> [%<fields>[,<token>]]
28+
29+
The second argument contains a percent character followed by a list of fields
30+
requested by the client. Each field is represented by a letter. The standard
31+
fields are:
32+
33+
- `t`: return the `<token>` specified by the client
34+
- `c`: return an arbitrary channel the client is joined to
35+
- `u`: return the username
36+
- `i`: return the IP address
37+
- `h`: return the hostname
38+
- `s`: return the server name
39+
- `n`: return the nickname
40+
- `f`: return the `WHO` flags (away, server operator, etc)
41+
- `d`: return the hop count (distance)
42+
- `l`: return the number of seconds the user has been idle for
43+
- `a`: return the account name
44+
- `o`: return the channel op level
45+
- `r`: return the realname
46+
47+
Servers MAY support additional non-standard fields. Servers MUST NOT rely on
48+
the ordering of the fields.
49+
50+
Clients can also specify a token which will be returned by the server in the
51+
replies. The token MUST contain only digit characters and MUST contain at most
52+
3 characters. Clients MUST NOT include 't' in `<fields>` without specifying a
53+
token.
54+
55+
Servers MAY support additional non-standard flags before the percent character.
56+
57+
The server will reply with zero, one or more `RPL_WHOSPCRPL` replies, followed
58+
by a final `RPL_ENDOFWHO` reply. Servers MUST NOT send `RPL_WHOREPLY` replies.
59+
60+
## `RPL_WHOSPCRPL` (354) numeric reply
61+
62+
:<server> 354 <client> [token] [channel] [user] [ip] [host] [server] [nick] [flags] [hopcount] [idle] [account] [oplevel] [:realname]
63+
64+
Servers MUST send the fields in the order specified above. Servers MUST include
65+
in their reply all of the standard fields requested by the client, and MUST NOT
66+
add any additional field not requested by the client. Servers MUST ignore any
67+
non-standard field they don't support.
68+
69+
Exactly the fields requested by the client MUST be returned by the server. When
70+
the server omits a field the client has requested, the following placeholders
71+
MUST be used:
72+
73+
- `*` is used for `[channel]` when no channel is returned.
74+
- `255.255.255.255` is used for `[ip]` when the server refuses to disclose the
75+
IP address.
76+
- `0` is used for `[account]` when the user is logged out.
77+
- Any syntactically correct placeholder can be used for `[oplevel]` when the
78+
server doesn't support op levels, for instance `n/a`.
79+
80+
Clients SHOULD ignore the values of the hop count (`d`) and the channel op
81+
level (`o`) fields, because they are ill-defined and unreliable.
82+
83+
## Examples
84+
85+
### Without a token
86+
87+
WHO cooluser %cuhnar
88+
:irc.example.org 354 mynick #ircv3 ~cooluser coolhost cooluser coolaccount :Cool User
89+
:irc.example.org 315 mynick cooluser :End of WHO list
90+
91+
### With a token
92+
93+
WHO #ircv3 %afnt,42
94+
:irc.example.org 354 mynick #ircv3 42 cooluser H coolaccount
95+
:irc.example.org 354 mynick #ircv3 42 cooloper H* cooloper
96+
:irc.example.org 315 mynick #ircv3 :End of WHO list

0 commit comments

Comments
 (0)