diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-10 11:16:17 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-10 11:16:17 +0000 |
commit | e3a4d6113dc8bd21f98882350b1317137df4c96c (patch) | |
tree | 407563a74b76ceaecf8de7839d645aab4250169b | |
parent | 26d7a95ed5209a250624b36427204157d3d8f7f6 (diff) |
Add optional SAPART reason. No prefixing done yet.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8689 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_sapart.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 13a9b0c90..dc230cae2 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -23,16 +23,24 @@ class CommandSapart : public Command CommandSapart (InspIRCd* Instance) : Command(Instance,"SAPART", 'o', 2, false, 0) { this->source = "m_sapart.so"; - syntax = "<nick> <channel>"; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + syntax = "<nick> <channel> [reason]"; + TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle (const char** parameters, int pcnt, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); Channel* channel = ServerInstance->FindChan(parameters[1]); + std::string reason; + if (dest && channel) { + ServerInstance->Log(DEBUG, "SAPART: pcnt is %d", pcnt); + if (pcnt == 3) + reason = parameters[2]; + else + reason = dest->nick; + if (ServerInstance->ULine(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); @@ -45,7 +53,7 @@ class CommandSapart : public Command */ if (IS_LOCAL(dest)) { - if (!channel->PartUser(dest, dest->nick)) + if (!channel->PartUser(dest, reason.c_str())) delete channel; Channel* n = ServerInstance->FindChan(parameters[1]); if (!n) |