summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/protocol/inspircd12.c50
-rw-r--r--src/protocol/inspircd20.c34
-rw-r--r--version.log2
3 files changed, 67 insertions, 19 deletions
diff --git a/src/protocol/inspircd12.c b/src/protocol/inspircd12.c
index 582e4162d..c0e3e8485 100644
--- a/src/protocol/inspircd12.c
+++ b/src/protocol/inspircd12.c
@@ -1453,10 +1453,26 @@ int anope_event_topic(char *source, int ac, char **av)
int anope_event_squit(char *source, int ac, char **av)
{
- if (ac != 2)
- return MOD_CONT;
- do_squit(source, ac, av);
- return MOD_CONT;
+ Server *s;
+
+ if (ac != 2)
+ return MOD_CONT;
+
+ s = findserver(servlist, av[0]);
+ if (!s)
+ s = findserver_uid(servlist, av[0]);
+ if (s && (s->flags & SERVER_JUPED))
+ {
+ /* a squit for a juped server is not possible, this is an squit for a
+ * server we have just juped and already internally quit. introduce the
+ * new server now.
+ */
+ inspircd_cmd_server(s->name, s->hops, s->desc, s->suid);
+ }
+ else
+ do_squit(source, ac, av);
+
+ return MOD_CONT;
}
int anope_event_rsquit(char *source, int ac, char **av)
@@ -2427,17 +2443,25 @@ int inspircd_flood_mode_check(char *value)
void inspircd_cmd_jupe(char *jserver, char *who, char *reason)
{
- char rbuf[256];
- char *sid;
+ char rbuf[256];
+ char *sid;
+ boolean found = false;
+ Server *s;
- snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", who,
- reason ? ": " : "", reason ? reason : "");
+ for (sid = ts6_sid_retrieve(); findserver_uid(servlist, sid); sid = ts6_sid_retrieve());
- if (findserver(servlist, jserver))
- inspircd_cmd_squit(jserver, rbuf);
- for (sid = ts6_sid_retrieve(); findserver_uid(servlist, sid); sid = ts6_sid_retrieve());
- inspircd_cmd_server(jserver, 1, rbuf, sid);
- new_server(me_server, jserver, rbuf, SERVER_JUPED, sid);
+ snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", who,
+ reason ? ": " : "", reason ? reason : "");
+
+ if (findserver(servlist, jserver))
+ {
+ send_cmd(TS6SID, "RSQUIT %s :%s", jserver, rbuf);
+ do_squit(who, 1, &jserver);
+ found = true;
+ }
+ s = new_server(me_server, jserver, rbuf, SERVER_JUPED, sid);
+ if (!found)
+ inspircd_cmd_server(s->name, s->hops, s->desc, s->suid);
}
/* GLOBOPS - to handle old WALLOPS */
diff --git a/src/protocol/inspircd20.c b/src/protocol/inspircd20.c
index 3b773ed54..0630a6600 100644
--- a/src/protocol/inspircd20.c
+++ b/src/protocol/inspircd20.c
@@ -1459,9 +1459,25 @@ int anope_event_topic(char *source, int ac, char **av)
int anope_event_squit(char *source, int ac, char **av)
{
+ Server *s;
+
if (ac != 2)
return MOD_CONT;
- do_squit(source, ac, av);
+
+ s = findserver(servlist, av[0]);
+ if (!s)
+ s = findserver_uid(servlist, av[0]);
+ if (s && (s->flags & SERVER_JUPED))
+ {
+ /* a squit for a juped server is not possible, this is an squit for a
+ * server we have just juped and already internally quit. introduce the
+ * new server now.
+ */
+ inspircd_cmd_server(s->name, s->hops, s->desc, s->suid);
+ }
+ else
+ do_squit(source, ac, av);
+
return MOD_CONT;
}
@@ -2419,15 +2435,23 @@ void inspircd_cmd_jupe(char *jserver, char *who, char *reason)
{
char rbuf[256];
char *sid;
+ boolean found = false;
+ Server *s;
+
+ for (sid = ts6_sid_retrieve(); findserver_uid(servlist, sid); sid = ts6_sid_retrieve());
snprintf(rbuf, sizeof(rbuf), "Juped by %s%s%s", who,
reason ? ": " : "", reason ? reason : "");
if (findserver(servlist, jserver))
- inspircd_cmd_squit(jserver, rbuf);
- for (sid = ts6_sid_retrieve(); findserver_uid(servlist, sid); sid = ts6_sid_retrieve());
- inspircd_cmd_server(jserver, 1, rbuf, sid);
- new_server(me_server, jserver, rbuf, SERVER_JUPED, sid);
+ {
+ send_cmd(TS6SID, "RSQUIT %s :%s", jserver, rbuf);
+ do_squit(who, 1, &jserver);
+ found = true;
+ }
+ s = new_server(me_server, jserver, rbuf, SERVER_JUPED, sid);
+ if (!found)
+ inspircd_cmd_server(s->name, s->hops, s->desc, s->suid);
}
/* GLOBOPS - to handle old WALLOPS */
diff --git a/version.log b/version.log
index f80025371..b640e31b4 100644
--- a/version.log
+++ b/version.log
@@ -8,7 +8,7 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="9"
VERSION_EXTRA="-git"
-VERSION_BUILD="3122"
+VERSION_BUILD="3123"
# Changes since 1.8.8 Release
#Revision 3120 - Fix many memory leaks and valgrind warnings, see pull request #15