From cf01674e07484b90be41f0fb84dc18d7888284fc Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sat, 25 Aug 2012 00:43:50 +0200 Subject: m_knock Don't concatenate the knock reason, the command parser does it for us --- src/modules/m_knock.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/modules') 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 = " "; Penalty = 5; @@ -38,8 +38,6 @@ class CommandKnock : public Command CmdResult Handle (const std::vector ¶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; } -- cgit v1.2.3