diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-08-25 00:43:50 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-08-25 00:48:02 +0200 |
commit | cf01674e07484b90be41f0fb84dc18d7888284fc (patch) | |
tree | 8c279b2ca0e4520d721e196eac5aafa26f497413 /src/modules | |
parent | 7aacf739504c81305fb773426cc778e00233b8f4 (diff) |
m_knock Don't concatenate the knock reason, the command parser does it for us
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_knock.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 84838ec7f..8cd5088bc 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -28,7 +28,7 @@ class CommandKnock : public Command { public: - CommandKnock(Module* Creator) : Command(Creator,"KNOCK", 2) + CommandKnock(Module* Creator) : Command(Creator,"KNOCK", 2, 2) { syntax = "<channel> <reason>"; Penalty = 5; @@ -38,8 +38,6 @@ class CommandKnock : public Command CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { Channel* c = ServerInstance->FindChan(parameters[0]); - std::string line; - if (!c) { user->WriteNumeric(401, "%s %s :No such channel",user->nick.c_str(), parameters[0].c_str()); @@ -64,13 +62,7 @@ class CommandKnock : public Command return CMD_FAILURE; } - for (int i = 1; i < (int)parameters.size() - 1; i++) - { - line = line + parameters[i] + " "; - } - line = line + parameters[parameters.size()-1]; - - c->WriteChannelWithServ((char*)ServerInstance->Config->ServerName.c_str(), "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name.c_str(), user->nick.c_str(), c->name.c_str(), line.c_str()); + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name.c_str(), user->nick.c_str(), c->name.c_str(), parameters[1].c_str()); user->WriteServ("NOTICE %s :KNOCKing on %s", user->nick.c_str(), c->name.c_str()); return CMD_SUCCESS; } |