summaryrefslogtreecommitdiff
path: root/src/modules/m_sapart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_sapart.cpp')
-rw-r--r--src/modules/m_sapart.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp
index 36078ab06..b5f97a66a 100644
--- a/src/modules/m_sapart.cpp
+++ b/src/modules/m_sapart.cpp
@@ -49,9 +49,28 @@ class cmd_sapart : public command_t
user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick);
return CMD_FAILURE;
}
- ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
+
if (!channel->PartUser(dest, dest->nick))
delete channel;
+ chanrec* n = ServerInstance->FindChan(parameters[1]);
+ if (!n)
+ {
+ ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ if (!n->HasUser(dest))
+ {
+ ServerInstance->WriteOpers(std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]);
+ return CMD_SUCCESS;
+ }
+ else
+ {
+ user->WriteServ("NOTICE %s :*** Unable to make %s part %s",user->nick, dest->nick, parameters[1]);
+ return CMD_FAILURE;
+ }
+ }
return CMD_SUCCESS;
}