diff options
-rw-r--r-- | include/commands/cmd_who.h | 3 | ||||
-rw-r--r-- | src/cmd_who.cpp | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/commands/cmd_who.h b/include/commands/cmd_who.h index 864dd6cb7..bc1601358 100644 --- a/include/commands/cmd_who.h +++ b/include/commands/cmd_who.h @@ -36,8 +36,9 @@ class cmd_who : public command_t bool opt_metadata; bool opt_port; bool opt_away; + bool opt_local; public: - cmd_who (InspIRCd* Instance) : command_t(Instance,"WHO",0,1) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiap]"; } + cmd_who (InspIRCd* Instance) : command_t(Instance,"WHO",0,1) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiapl]"; } void SendWhoLine(userrec* user, const std::string &initial, chanrec* ch, userrec* u, std::vector<std::string> &whoresults); CmdResult Handle(const char** parameters, int pcnt, userrec *user); bool whomatch(userrec* user, const char* matchtext); diff --git a/src/cmd_who.cpp b/src/cmd_who.cpp index dad3b90b8..097059498 100644 --- a/src/cmd_who.cpp +++ b/src/cmd_who.cpp @@ -44,6 +44,9 @@ bool cmd_who::whomatch(userrec* user, const char* matchtext) if (user->registered != REG_ALL) return false; + if (opt_local && !IS_LOCAL(user)) + return false; + if (opt_mode) { for (const char* n = matchtext; *n; n++) @@ -174,6 +177,7 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user) opt_metadata = false; opt_port = false; opt_away = false; + opt_local = false; chanrec *ch = NULL; std::vector<std::string> whoresults; @@ -224,6 +228,9 @@ CmdResult cmd_who::Handle (const char** parameters, int pcnt, userrec *user) case 'a': opt_away = true; break; + case 'l': + opt_local = true; + break; } *iter++; |