diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-04-04 18:30:02 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-04-04 18:30:02 +0200 |
commit | 23183603b7ea3b2a50ce082d573bef07ab794686 (patch) | |
tree | e6076a2aeeac67c6dca294f83b30f9d326d24d70 /src/modules | |
parent | 957676efd8e1330f1e1314046376f3d9dd1eab18 (diff) |
Add REG_ALL checks to treat unregistered users as nonexistent in more cases
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_samode.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_saquit.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/idle.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_watch.cpp | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 9b71992a6..ea2ae24ab 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -39,6 +39,16 @@ class CommandSamode : public Command CmdResult Handle (const std::vector<std::string>& parameters, User *user) { + if (parameters[0].c_str()[0] != '#') + { + User* target = ServerInstance->FindNickOnly(parameters[0]); + if ((!target) || (target->registered != REG_ALL)) + { + user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); + return CMD_FAILURE; + } + } + this->active = true; ServerInstance->Parser->CallHandler("MODE", parameters, user); if (ServerInstance->Modes->GetLastParse().length()) diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 3b7bdc824..909a026ab 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -37,7 +37,7 @@ class CommandSaquit : public Command CmdResult Handle (const std::vector<std::string>& parameters, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); - if ((dest) && (!IS_SERVER(dest))) + if ((dest) && (!IS_SERVER(dest)) && (dest->registered == REG_ALL)) { if (ServerInstance->ULine(dest->server)) { diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp index 8bc0cd2bb..0ea06a3cc 100644 --- a/src/modules/m_spanningtree/idle.cpp +++ b/src/modules/m_spanningtree/idle.cpp @@ -59,7 +59,7 @@ bool TreeSocket::Whois(const std::string &prefix, parameterlist ¶ms) { std::string who_did_the_whois = params[0]; User* who_to_send_to = ServerInstance->FindNick(who_did_the_whois); - if ((who_to_send_to) && (IS_LOCAL(who_to_send_to))) + if ((who_to_send_to) && (IS_LOCAL(who_to_send_to)) && (who_to_send_to->registered == REG_ALL)) { // an incoming reply to a whois we sent out std::string nick_whoised = prefix; diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index fa7e212bb..0e532d65b 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -238,7 +238,7 @@ class CommandWatch : public Command } User* target = ServerInstance->FindNick(nick); - if (target) + if ((target) && (target->registered == REG_ALL)) { (*wl)[nick] = std::string(target->ident).append(" ").append(target->dhost).append(" ").append(ConvToStr(target->age)); user->WriteNumeric(604, "%s %s %s :is online",user->nick.c_str(), nick, (*wl)[nick].c_str()); |