This wonderful command is missing something. The query type feature is very useful for scripts to grab the correct replies, but it is not returned in the end of /WHO reply. This can make it difficult to deal with the reply, certainly in case no results were returned.
A simple trick can be used, by including the query type in the mask part, for example:
-> WHO nick1,nick2,nick3,123 n%nat,123
<- :irc.undernet.org 315 wiebe nick1,nick2,nick3,123 :End of /WHO list.
Very handy trick as a number cannot be a valid nick or channel, but this only works when the input are plain nicks and channels, as only then are commas allowed.
Changing to code to allow the query type in the mask parameter for other than plain nick/chan requests (e.g. WHO somenick*,123 n%nat,123), seems complicated. Just changing the server reply 315 RPL_ENDOFWHO would break clients (even for just special WHO requests).
A way that would not break clients, is to add a new flag (e.g. z). When this flag is specified, return the query type in the end of who reply, perhaps even a different reply (e.g. 316 RPL_ENDOFSPECIALWHO), for example:
-> WHO nick* n%nazt,123
<- :irc.undernet.org 316 wiebe nick* 123 :End of /WHO list.
Clients that want to get the query type returned there, can specify the flag and be ready to parse it. Clients that dont want to get it, or dont know about it, wont notice any difference. The z flag and 316 numeric are just randomly made up for the example.
Log in to post a comment.