From d0706f5d5702898a4f9c3d2ceb8b1da3daad38c4 Mon Sep 17 00:00:00 2001 From: peavey Date: Wed, 13 Jun 2007 19:30:34 +0000 Subject: new rsquit command handler, this is still work in progress. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7286 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/rsquit.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 2077bd68c..a60d102fa 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -44,7 +44,22 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user) { if (IS_LOCAL(user)) { - return (CmdResult)((ModuleSpanningTree*)Creator)->HandleSquit(parameters, pcnt, user, true); + if (!Utils->FindServerMask(parameters[0])) + { + user->WriteServ("NOTICE %s :*** RSQUIT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0]); + return CMD_FAILURE; + } + user->WriteServ("NOTICE %s :*** RSQUIT: Sending remote squit to \002%s\002 to squit server \002%s\002.",user->nick,parameters[0],parameters[1]); } + + if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0])) + { + ServerInstance->SNO->WriteToSnoMask('l',"Remote SQUIT from %s matching \002%s\002, squitting server \002%s\002",user->nick,parameters[0],parameters[1]); + const char* para[1]; + para[0] = parameters[1]; + std::string original_command = std::string("SQUIT ") + parameters[1]; + Creator->OnPreCommand("SQUIT", para, 1, user, true, original_command); + } + return CMD_SUCCESS; } -- cgit v1.2.3