Difference between revisions of "Who"

From Scriptwiki
Jump to: navigation, search
Line 57: Line 57:
 
   c  Include (first) channel name
 
   c  Include (first) channel name
 
   u  Include userID with eventual ~
 
   u  Include userID with eventual ~
   i  Include IP (always show your own real IP, always 127.0.0.1 for others)
+
   i  Include IP (always shows your own real IP, and 127.0.0.1 for others)
 
   h  Include hostname
 
   h  Include hostname
 
   s  Include server name
 
   s  Include server name

Revision as of 16:52, 7 April 2007

syntax: /WHO <mask> [[<flags>][%<fields>[,<querytype>]] [:<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 containt 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*"


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
  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 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 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


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

  t   Include the querytype in the reply
  c   Include (first) channel name
  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
  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
  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

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 nick, user and hostname for nick
/WHO #chan %nuhft,567      show nick, user, host and flags for users on #chan

Unfortunately, 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
/WHO #chan,567 %nuhft,567

Only specified fields are returned, 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 note

link to /KICK for zombie

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