diff options
| author | 2014-04-04 18:30:02 +0200 | |
|---|---|---|
| committer | 2014-04-04 18:30:02 +0200 | |
| commit | 23183603b7ea3b2a50ce082d573bef07ab794686 (patch) | |
| tree | e6076a2aeeac67c6dca294f83b30f9d326d24d70 /src/modules/m_samode.cpp | |
| parent | Fix typos and update text in the configure script (diff) | |
Add REG_ALL checks to treat unregistered users as nonexistent in more cases
Diffstat (limited to 'src/modules/m_samode.cpp')
| -rw-r--r-- | src/modules/m_samode.cpp | 10 |
1 files changed, 10 insertions, 0 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()) |
