summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-28 01:32:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-28 01:32:07 +0000
commit88914882ae3ccadcdca2a4c678d319af3c808cfd (patch)
tree91a8750b4c18bb627ee89f745c178149c9cfe944
parent7417ff9a5fd889be887ad9e8c63fb36168416815 (diff)
Added remote squit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1234 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/commands.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index f8d4c208d..bde708b82 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1538,7 +1538,42 @@ void handle_squit(char **parameters, int pcnt, userrec *user)
}
else
{
- WriteServ(user->fd,"NOTICE :*** Remote SQUIT not supported yet.");
+ if (!strcasecmp(ServerName,parameters[0]))
+ {
+ WriteServ(user->fd,"NOTICE %s :*** To take the local server out of the mesh, just use /SQUIT with no parameters instead.",user->nick);
+ return;
+ }
+ bool have_this_server = false;
+ for (int j = 0; j < 32; j++)
+ {
+ if (me[j] != NULL)
+ {
+ for (int x = 0; x < me[j]->connectors.size(); x++)
+ {
+ if (!strcasecmp(me[j]->connectors[x].GetServerName().c_str(),parameters[0]))
+ {
+ if ((me[j]->connectors[x].GetState() == STATE_CONNECTED) || (me[j]->connectors[x].GetState() == STATE_SERVICES))
+ {
+ // found a valid ircd_connector.
+ have_this_server = true;
+ return;
+ }
+ }
+ }
+ }
+ }
+ if (have_this_server)
+ {
+ WriteOpers("SQUIT command issued by %s to remove %s from the mesh",user->nick,parameters[0]);
+ char buffer[MAXBUF];
+ snprintf(buffer,MAXBUF,"& %s",parameters[0]);
+ NetSendToAll(buffer);
+ DoSplit(parameters[0]);
+ }
+ else
+ {
+ WriteServ(user->fd,"NOTICE %s :*** No such server exists in the mesh.",user->nick);
+ }
}
}