diff options
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()) |