diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-08-06 13:10:58 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-08-06 13:10:58 +0200 |
commit | 3f6f010fc878ff56c48104b936c5b3d363aafa04 (patch) | |
tree | d7bc8092f7ce8265c300ed457ee101e5cd420f90 /src/modules | |
parent | 5189e878d24e7e65de1e81aaab10b8d5d9dd6cae (diff) |
m_spanningtree Remove redundant checks from HandleRemoteWhois()
The size of the vector is checked in OnPreCommand() and that hook only runs for local users
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/override_whois.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index d7030e30a..430467dc7 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -23,20 +23,17 @@ ModResult ModuleSpanningTree::HandleRemoteWhois(const std::vector<std::string>& parameters, User* user) { - if ((IS_LOCAL(user)) && (parameters.size() > 1)) + User* remote = ServerInstance->FindNickOnly(parameters[1]); + if (remote && !IS_LOCAL(remote)) { - User* remote = ServerInstance->FindNickOnly(parameters[1]); - if (remote && !IS_LOCAL(remote)) - { - CmdBuilder(user, "IDLE").push(remote->uuid).Unicast(remote); - return MOD_RES_DENY; - } - else if (!remote) - { - user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[1].c_str()); - user->WriteNumeric(RPL_ENDOFWHOIS, "%s :End of /WHOIS list.", parameters[1].c_str()); - return MOD_RES_DENY; - } + CmdBuilder(user, "IDLE").push(remote->uuid).Unicast(remote); + return MOD_RES_DENY; + } + else if (!remote) + { + user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[1].c_str()); + user->WriteNumeric(RPL_ENDOFWHOIS, "%s :End of /WHOIS list.", parameters[1].c_str()); + return MOD_RES_DENY; } return MOD_RES_PASSTHRU; } |