Difference between revisions of "Who"

From Scriptwiki
Jump to: navigation, search
m
m
Line 2: Line 2:
 
syntax: /WHO <mask> [[<flags>][%<fields>[,<querytype>]] [:<mask>]]
 
syntax: /WHO <mask> [[<flags>][%<fields>[,<querytype>]] [:<mask>]]
  
 +
 +
 +
== mask ==
 
Parameter <mask> can be:
 
Parameter <mask> can be:
  
Line 21: Line 24:
  
  
 
+
== match ==
 
Field matching flags, when one of these is specified the field in question is matched against the mask, otherwise it is not matched.
 
Field matching flags, when one of these is specified the field in question is matched against the mask, otherwise it is not matched.
 
  n  Nick
 
  n  Nick
Line 43: Line 46:
  
  
 
+
=== user mode match ===
 
User mode matching flags:
 
User mode matching flags:
 
  d  Join-delayed channel members (new in snircd)
 
  d  Join-delayed channel members (new in snircd)
Line 58: Line 61:
  
  
 
+
=== special purpose match ===
 
Special purpose flags:
 
Special purpose flags:
  
Line 75: Line 78:
  
  
 +
== fields ==
 
The parameter <fields> specifies which fields to include in the output as:
 
The parameter <fields> specifies which fields to include in the output as:
 
  t  Include the querytype in the reply
 
  t  Include the querytype in the reply
Line 96: Line 100:
 
  ; show nick, user, host and flags for users on #chan
 
  ; show nick, user, host and flags for users on #chan
  
 +
 +
=== query type ===
 
The parameter <querytype> is to be used with the "t" field flag, and can be any number between 0-999 inclusive (default is 0). This number is returned in the output, useful to filter the output in scripts.
 
The parameter <querytype> is to be used with the "t" field flag, and can be any number between 0-999 inclusive (default is 0). This number is returned in the output, useful to filter the output in scripts.
  
 
  /WHO nick n%nuht,123
 
  /WHO nick n%nuht,123
  ; show nick, user and hostname for nick
+
  ; show 123, nick, user and hostname for nick
  
 
  /WHO #chan %nuhft,567
 
  /WHO #chan %nuhft,567
  ; show nick, user, host and flags for users on #chan
+
  ; show 567, nick, user, host and flags for users on #chan
  
The querytype number is not returned in the "end of /WHO list." reply, a trick can be used, but only for flat nicks and channels.
+
The querytype number is not returned in the [[Raw_315|"end of /WHO list."]] reply, a trick can be used, but only for flat nicks and channels.
  
 
  /WHO nick,123 n%nuht,123
 
  /WHO nick,123 n%nuht,123
  ; same as above, but then with 123 returned in the end of reply
+
  ; same as above, with 123 returned in the end of reply
  
 
  /WHO #chan,567 %nuhft,567
 
  /WHO #chan,567 %nuhft,567
  ; same as above, but then with 123 returned in the end of reply
+
  ; same as above, with 567 returned in the end of reply
 +
 
 +
 
 +
== misc ==
 +
Only specified fields are returned in [[Raw_354|raw 354]], but always in the same order:
  
Only specified fields are returned, but always in the same order:
+
[<querytype>] [<channel>] [<user>] [<ip>] [<host>] [<server>] [<nick>] [<flags>] [<distance>]
[<querytype>] [<channel>] [<user>] [<ip>] [<host>] [<server>] [<nick>] [<flags>] [<distance>] [<idle time>] [<account>] [<oplevel>] [:<realname>]
+
  [<idle time>] [<account>] [<oplevel>] [:<realname>]
  
The <flags> parameter in both type of replies is formated as <away>[<oper>][<chanstatus>][<usermodes>]. The user's away status is indicated with a "H" (here) or a "G" (gone). IRC Operator status is indicated with a "*". The user's status on the channel in the reply is indicated with a "@" when opped, a "+" when voiced, a "!" when zombie, and "<" when hidden. When using field flags to control the output, more than one of such channel status flag may be returned, while the normal replies show only one. The usermodes part shows usermode "d" and "x" to users, IRC Operators can see usermodes "i", "w" "g" and "h" as well.
+
The <flags> parameter in both type of replies is formated as <away>[<oper>][<chanstatus>][<usermodes>]. The user's away status is indicated with a "H" (here) or a "G" (gone). IRC Operator status is indicated with a "*". The user's status on the channel in the reply is indicated with a "@" when opped, a "+" when voiced, a "!" when [[kick|zombie]], and "<" when hidden. When using field flags to control the output, more than one of such channel status flag may be returned, while the normal replies show only one. The usermodes part shows usermode "d" and "x" to users, IRC Operators can see usermodes "i", "w" "g" and "h" as well.
  
 
The match and field flags are case insensitive, and the order in which they are specified does not matter. The maximum number of lines reported as reply for a query is "2048/(n+4)" where "n" is the number of field flags specified. This limit does not apply when the request is for a channel the client is on.
 
The match and field flags are case insensitive, and the order in which they are specified does not matter. The maximum number of lines reported as reply for a query is "2048/(n+4)" where "n" is the number of field flags specified. This limit does not apply when the request is for a channel the client is on.
Line 138: Line 148:
  
  
internal note
+
internal notes
  
 
link to /KICK for zombie
 
link to /KICK for zombie
  
 
link to /MODE or modes for +ps and +i
 
link to /MODE or modes for +ps and +i
 +
 +
link to /AWAY
 +
 +
link to raw 315 352 354 in text
 +
 +
link to IAL etc, explains which sort updates the IAL

Revision as of 12:05, 8 April 2007

syntax: /WHO <mask> [[<flags>][%<fields>[,<querytype>]] [:<mask>]]


mask

Parameter <mask> can be:

A comma separated list of elements, then each element is treated as a flat channel or nick name and is not matched to other elements.

/WHO #chan1,#chan2
; show members on #chan1 and #chan2
/WHO nick1,nick2,nick3
; show info for nick1, nick2 and nick3
/WHO nick,#chan
; show members on #chan and info for nick

A single mask (no commas, only one element) and may contain wildcards, the mask is first checked to be a full channel or nickname, then it is matched against the given flags (default nuhsr).

/WHO a?cd*
; show users matching "a?cd*"


match

Field matching flags, when one of these is specified the field in question is matched against the mask, otherwise it is not matched.

n   Nick
u   Username
h   Hostname
i   Numeric IP (disabled on QuakeNet)
s   Servername (disabled on QuakeNet)
r   Realname
a   Account name (new in snircd)

The second <mask> parameter can be used, and may contain spaces for matching the realname field. The first <mask> parameter is ignored when the second is used.

/WHO *.org h
; show users with hostname matching *.org
/WHO *uk* nu
; show users with "uk" in their nick or username
/WHO 0 r :*bot service*
; show users with "bot service" in their realname


user mode match

User mode matching flags:

d   Join-delayed channel members (new in snircd)
o   IRC Operator (specifying this one means only IRC Operators are matched)
/WHO #chan1,#chan2 d
; show join-delayed channel members
/WHO * o
; show IRC Operators
/WHO #chan1,#chan2 o
; show IRC Operators on #chan1 and #chan2


special purpose match

Special purpose flags:

  x   Extended visibility of information for opers.

IRC Operators may use this flag to see in private (+p) or secret (+s) channels, and see invisible (+i) users. Only IRC Operators can use this flag, else it is ignored.

/WHO #chan x
; show all users on #chan
/WHO flood* nx
; show all users with nick matching "flood*"
/WHO 1.2.3.4 ix
; show all users connected from 1.2.3.4


fields

The parameter <fields> specifies which fields to include in the output as:

t   Include the querytype in the reply
c   Include (first) channel name (* when none can be shown)
u   Include userID with eventual ~
i   Include IP (always shows your own real IP, and 127.0.0.1 for others)
h   Include hostname
s   Include server name (always *.quakenet.org)
n   Include nick
f   Include flags
d   Include "distance" in hops (always 3 for others, 0 for yourself)
l   Include idle time (only works for yourself)
a   Include account name (0 when not authed)
o   Include oplevel (shows 999 to users without ops in the channel) (new in snircd, ignore for now)
r   Include real name
/WHO nick n%nuh
; show nick, user and hostname for nick
/WHO #chan %nuhf
; show nick, user, host and flags for users on #chan


query type

The parameter <querytype> is to be used with the "t" field flag, and can be any number between 0-999 inclusive (default is 0). This number is returned in the output, useful to filter the output in scripts.

/WHO nick n%nuht,123
; show 123, nick, user and hostname for nick
/WHO #chan %nuhft,567
; show 567, nick, user, host and flags for users on #chan

The querytype number is not returned in the "end of /WHO list." reply, a trick can be used, but only for flat nicks and channels.

/WHO nick,123 n%nuht,123
; same as above, with 123 returned in the end of reply
/WHO #chan,567 %nuhft,567
; same as above, with 567 returned in the end of reply


misc

Only specified fields are returned in raw 354, but always in the same order:

[<querytype>] [<channel>] [<user>] [<ip>] [<host>] [<server>] [<nick>] [<flags>] [<distance>]
  [<idle time>] [<account>] [<oplevel>] [:<realname>]

The <flags> parameter in both type of replies is formated as <away>[<oper>][<chanstatus>][<usermodes>]. The user's away status is indicated with a "H" (here) or a "G" (gone). IRC Operator status is indicated with a "*". The user's status on the channel in the reply is indicated with a "@" when opped, a "+" when voiced, a "!" when zombie, and "<" when hidden. When using field flags to control the output, more than one of such channel status flag may be returned, while the normal replies show only one. The usermodes part shows usermode "d" and "x" to users, IRC Operators can see usermodes "i", "w" "g" and "h" as well.

The match and field flags are case insensitive, and the order in which they are specified does not matter. The maximum number of lines reported as reply for a query is "2048/(n+4)" where "n" is the number of field flags specified. This limit does not apply when the request is for a channel the client is on.

 1 field  returned = maximum 409 replies
 2 fields returned = maximum 341 replies
 3 fields returned = maximum 292 replies
 4 fields returned = maximum 256 replies
 5 fields returned = maximum 227 replies
 6 fields returned = maximum 204 replies
 7 fields returned = maximum 186 replies (default query)
 8 fields returned = maximum 170 replies
 9 fields returned = maximum 157 replies
10 fields returned = maximum 146 replies

The status of a channel private (+p) and secret (+s), as well as users being invisible (+i) may affect the result of /WHO.

For more info, visit https://svn.quakenet.org/svn/quakenet/snircd/trunk/doc/readme.who


internal notes

link to /KICK for zombie

link to /MODE or modes for +ps and +i

link to /AWAY

link to raw 315 352 354 in text

link to IAL etc, explains which sort updates the IAL