+ if (Req->argc > 2)
+ return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+ Client_ID(Client), Req->command);
+
+ only_ops = false;
+ have_arg = false;
+
+ if (Req->argc == 2) {
+ if (strcmp(Req->argv[1], "o") == 0)
+ only_ops = true;
+#ifdef STRICT_RFC
+ else
+ return IRC_WriteStrClient(Client,
+ ERR_NEEDMOREPARAMS_MSG,
+ Client_ID(Client),
+ Req->command);
+#endif
+ }
+
+ IRC_SetPenalty(Client, 1);
+ if (Req->argc >= 1) {
+ /* Channel or mask given */
+ chan = Channel_Search(Req->argv[0]);
+ if (chan) {
+ /* Members of a channel have been requested */
+ IRC_SetPenalty(Client, 1);
+ return IRC_WHO_Channel(Client, chan, only_ops);
+ }
+ if (strcmp(Req->argv[0], "0") != 0) {
+ /* A mask has been given. But please note this RFC
+ * stupidity: "0" is same as no arguments ... */
+ IRC_SetPenalty(Client, 3);
+ return IRC_WHO_Mask(Client, Req->argv[0], only_ops);
+ }
+ }
+
+ /* No channel or (valid) mask given */
+ IRC_SetPenalty(Client, 2);
+ return IRC_WHO_Mask(Client, NULL, only_ops);