diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-10 11:47:15 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-10 11:47:15 +0000 |
commit | 84083a73e80734e39892f44411549d2381654c95 (patch) | |
tree | 19b6a57980e6d18c34125548e95cda95044c47f9 /src/commands | |
parent | e3a4d6113dc8bd21f98882350b1317137df4c96c (diff) |
Implement <options:prefixpart|suffixpart|fixedpart>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8690 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_part.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/commands/cmd_part.cpp b/src/commands/cmd_part.cpp index 46108eca2..aaff9e30f 100644 --- a/src/commands/cmd_part.cpp +++ b/src/commands/cmd_part.cpp @@ -21,6 +21,25 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandPart::Handle (const char** parameters, int pcnt, User *user) { + std::string reason; + + if (IS_LOCAL(user)) + { + if (*ServerInstance->Config->FixedPart) + reason = ServerInstance->Config->FixedPart; + else + { + if (pcnt > 1) + reason = ServerInstance->Config->PrefixPart + std::string(parameters[1]) + ServerInstance->Config->SuffixPart; + else + reason = ""; + } + } + else + { + reason = pcnt ? parameters[1] : ""; + } + if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) return CMD_SUCCESS; @@ -28,7 +47,8 @@ CmdResult CommandPart::Handle (const char** parameters, int pcnt, User *user) if (c) { - if (!c->PartUser(user, pcnt > 1 ? parameters[1] : NULL)) + const char *rreason = reason.empty() ? NULL : reason.c_str(); + if (!c->PartUser(user, rreason)) /* Arse, who stole our channel! :/ */ delete c; } |