From 9c2e2ef9d24c348f42261d32f424ad04865b19ef Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 4 Jul 2012 21:24:22 +0200 Subject: m_spanningtree RSQUIT handler: Don't reimplement sending messages to remote users Use ModuleSpanningTree::RemoteMessage instead --- src/modules/m_spanningtree/commands.h | 1 - src/modules/m_spanningtree/rsquit.cpp | 21 ++------------------- 2 files changed, 2 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h index 93455c8c4..1bca63564 100644 --- a/src/modules/m_spanningtree/commands.h +++ b/src/modules/m_spanningtree/commands.h @@ -39,7 +39,6 @@ class CommandRSQuit : public Command CommandRSQuit(Module* Callback, SpanningTreeUtilities* Util); CmdResult Handle (const std::vector& parameters, User *user); RouteDescriptor GetRouting(User* user, const std::vector& parameters); - void NoticeUser(User* user, const std::string &msg); }; class CommandSVSJoin : public Command diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 027ae02ab..0e4342227 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -43,13 +43,13 @@ CmdResult CommandRSQuit::Handle (const std::vector& parameters, Use server_target = Utils->FindServerMask(parameters[0]); if (!server_target) { - user->WriteServ("NOTICE %s :*** RSQUIT: Server \002%s\002 isn't connected to the network!", user->nick.c_str(), parameters[0].c_str()); + ((ModuleSpanningTree*)(Module*)creator)->RemoteMessage(user, "*** RSQUIT: Server \002%s\002 isn't connected to the network!", parameters[0].c_str()); return CMD_FAILURE; } if (server_target == Utils->TreeRoot) { - NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+parameters[0]+" matches local server name)"); + ((ModuleSpanningTree*)(Module*)creator)->RemoteMessage(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)", parameters[0].c_str()); return CMD_FAILURE; } @@ -75,20 +75,3 @@ RouteDescriptor CommandRSQuit::GetRouting(User* user, const std::vectorWriteServ("NOTICE %s :%s",user->nick.c_str(),msg.c_str()); - } - else - { - parameterlist params; - params.push_back(user->nick); - params.push_back("NOTICE "+ConvToStr(user->nick)+" :"+msg); - Utils->DoOneToOne(ServerInstance->Config->GetSID(), "PUSH", params, user->server); - } -} - -- cgit v1.2.3