diff options
Diffstat (limited to 'src/modules/m_sapart.cpp')
-rw-r--r-- | src/modules/m_sapart.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 1b2ef34b0..6de01c852 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -49,6 +49,12 @@ class CommandSapart : public Command return CMD_FAILURE; } + if (!channel->HasUser(dest)) + { + user->WriteNotice("*** " + dest->nick + " is not on " + channel->name); + return CMD_FAILURE; + } + /* For local clients, directly part them generating a PART message. For remote clients, * just return CMD_SUCCESS knowing the protocol module will route the SAPART to the users * local server and that will generate the PART instead @@ -56,26 +62,7 @@ class CommandSapart : public Command if (IS_LOCAL(dest)) { channel->PartUser(dest, reason); - - Channel* n = ServerInstance->FindChan(parameters[1]); - if (!n) - { - ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAPART to make "+dest->nick+" part "+parameters[1]); - return CMD_SUCCESS; - } - else - { - if (!n->HasUser(dest)) - { - ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAPART to make "+dest->nick+" part "+parameters[1]); - return CMD_SUCCESS; - } - else - { - user->WriteNotice("*** Unable to make " + dest->nick + " part " + parameters[1]); - return CMD_FAILURE; - } - } + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAPART to make "+dest->nick+" part "+channel->name); } return CMD_SUCCESS; |