1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 13:43:14 +02:00

Properly jupe servers on inspircd by using RSQUIT, waiting for the corresponding SQUIT, and then introducing the new server

This commit is contained in:
Adam
2013-07-26 12:35:55 -04:00
parent a563c8fb2f
commit f7b1b1907c
3 changed files with 67 additions and 19 deletions
+37 -13
View File
@@ -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 */
+29 -5
View File
@@ -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 */
+1 -1
View File
@@ -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