summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-29 03:47:02 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-29 03:47:02 +0000
commit8a864d68bd6b1fd1bea16e7e45fa1e8765a2c7d2 (patch)
tree0436a6d7319bc463746b53bf0e294568eb84311d /src
parentc722453bce8880f40d85995bd24ccf527b2bc3cc (diff)
Should fix bug #183 (rconnect issues), thanks Bricker
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6154 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 3290878f4..472e4414c 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -619,12 +619,22 @@ class cmd_rconnect : public command_t
cmd_rconnect (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : command_t(Instance, "RCONNECT", 'o', 2), Creator(Callback), Utils(Util)
{
this->source = "m_spanningtree.so";
- syntax = "<remote-server-mask> <servermask>";
+ syntax = "<remote-server-mask> <target-server-mask>";
}
CmdResult Handle (const char** parameters, int pcnt, userrec *user)
{
- user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]);
+ if (IS_LOCAL(user))
+ {
+ if (!Utils->FindServer(parameters[0]))
+ {
+ user->WriteServ("NOTICE %s :*** RCONNECT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0]);
+ return CMD_FAILURE;
+ }
+
+ user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]);
+ }
+
/* Is this aimed at our server? */
if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0]))
{
@@ -634,11 +644,9 @@ class cmd_rconnect : public command_t
para[0] = parameters[1];
std::string original_command = std::string("CONNECT ") + parameters[1];
Creator->OnPreCommand("CONNECT", para, 1, user, true, original_command);
-
- return CMD_SUCCESS;
}
-
- return CMD_FAILURE;
+
+ return CMD_SUCCESS;
}
};