diff --git a/include/h.h b/include/h.h index b0e8f2c46..f1aa4fc5f 100644 --- a/include/h.h +++ b/include/h.h @@ -285,6 +285,7 @@ extern char *myctime(time_t); extern char *short_date(time_t, char *buf); extern char *long_date(time_t); extern void exit_client(Client *client, MessageTag *recv_mtags, char *comment); +extern void exit_client_ex(Client *client, Client *origin, MessageTag *recv_mtags, char *comment); extern void initstats(), tstats(Client *, char *); extern char *check_string(char *); extern char *make_nick_user_host(char *, char *, char *); diff --git a/src/misc.c b/src/misc.c index a7c1c7fb3..dfc71446d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -584,7 +584,7 @@ static void recurse_send_quits(Client *cptr, Client *client, Client *from, Clien recurse_send_quits(cptr, acptr, from, to, mtags, comment, splitstr); } - if (cptr == client && to != from) + if (cptr == client && to != from && !(to->direction && (to->direction == from))) sendto_one(to, mtags, "SQUIT %s :%s", client->name, comment); } @@ -700,6 +700,16 @@ static void exit_one_client(Client *client, MessageTag *mtags_i, const char *com * @param comment The (s)quit message */ void exit_client(Client *client, MessageTag *recv_mtags, char *comment) +{ + return exit_client_ex(client, client->direction, recv_mtags, comment); +} + +/** Exit this IRC client, and all the dependents (users, servers) if this is a server. + * @param client The client to exit. + * @param recv_mtags Message tags to use as a base (if any). + * @param comment The (s)quit message + */ +void exit_client_ex(Client *client, Client *origin, MessageTag *recv_mtags, char *comment) { long long on_for; ConfigItem_listen *listen_conf; @@ -813,7 +823,7 @@ void exit_client(Client *client, MessageTag *recv_mtags, char *comment) else ircsnprintf(splitstr, sizeof splitstr, "%s %s", client->srvptr->name, client->name); - remove_dependents(client, client->direction, recv_mtags, comment, splitstr); + remove_dependents(client, origin, recv_mtags, comment, splitstr); RunHook2(HOOKTYPE_SERVER_QUIT, client, recv_mtags); } diff --git a/src/modules/squit.c b/src/modules/squit.c index 7ea2782bd..28325d3b2 100644 --- a/src/modules/squit.c +++ b/src/modules/squit.c @@ -144,15 +144,6 @@ CMD_FUNC(cmd_squit) sendto_umode_global(UMODE_OPER, "Received SQUIT %s from %s (%s)", target->name, get_client_name(client, FALSE), comment); } - if (IsOper(client)) - { - /* - * It was manually /squit'ed by a human being(we hope), - * there is a very good chance they don't want us to - * reconnect right away. -Cabal95 - */ - SetSQuit(target); - } - exit_client(target, recv_mtags, comment); + exit_client_ex(target, client->direction, recv_mtags, comment); }