diff --git a/src/modules/sajoin.c b/src/modules/sajoin.c index 1b2de4c63..286341e90 100644 --- a/src/modules/sajoin.c +++ b/src/modules/sajoin.c @@ -52,6 +52,13 @@ MOD_UNLOAD() return MOD_SUCCESS; } +static void log_sajoin(Client *client, Client *target, char *channels) +{ + unreal_log(ULOG_INFO, "sacmds", "SAJOIN_COMMAND", client, "SAJOIN: $client used SAJOIN to make $target join $channels", + log_data_client("target", target), + log_data_string("channels", channels)); +} + /* cmd_sajoin() - Lamego - Wed Jul 21 20:04:48 1999 Copied off PTlink IRCd (C) PTlink coders team. Coded for Sadmin by Stskeeps @@ -89,20 +96,18 @@ CMD_FUNC(cmd_sajoin) return; } + /* Broadcast so other servers can log it appropriately as an SAJOIN */ + sendto_server(client, 0, 0, recv_mtags, ":%s SAPART %s %s", client->id, target->id, parv[2]); + /* If it's not for our client, then simply pass on the message... */ if (!MyUser(target)) { - sendto_one(target, NULL, ":%s SAJOIN %s %s", client->id, target->id, parv[2]); - - /* Logging function added by XeRXeS */ - ircd_log(LOG_SACMDS,"SAJOIN: %s used SAJOIN to make %s join %s", - client->name, target->name, parv[2]); - unreal_log(ULOG_INFO, "sacmds", "SAJOIN_COMMAND", client, "SAJOIN: %s used SAJOIN to make %s join %s", - log_data_client("target", target), - log_data_string("channel", parv[2])); + log_sajoin(client, target, parv[2]); return; } + /* 'target' is our client... */ + /* Can't this just use do_join() or something with a parameter to bypass some checks? * This duplicate code is damn ugly. Ah well.. */ @@ -281,23 +286,10 @@ CMD_FUNC(cmd_sajoin) if (did_anything) { if (!sjmode) - { sendnotice(target, "*** You were forced to join %s", jbuf); - sendto_umode_global(UMODE_OPER, "%s used SAJOIN to make %s join %s", client->name, target->name, jbuf); - /* Logging function added by XeRXeS */ - ircd_log(LOG_SACMDS,"SAJOIN: %s used SAJOIN to make %s join %s", - client->name, target->name, jbuf); - } else - { sendnotice(target, "*** You were forced to join %s with '%c'", jbuf, sjmode); - sendto_umode_global(UMODE_OPER, "%s used SAJOIN to make %s join %c%s", client->name, target->name, sjmode, jbuf); - ircd_log(LOG_SACMDS,"SAJOIN: %s used SAJOIN to make %s join %c%s", - client->name, target->name, sjmode, jbuf); - } - unreal_log(ULOG_INFO, "sacmds", "SAJOIN_COMMAND", client, "SAJOIN: $client used SAJOIN to make $target join $channels", - log_data_client("target", target), - log_data_string("channels", jbuf)); + log_sajoin(client, target, jbuf); } } } diff --git a/src/modules/sapart.c b/src/modules/sapart.c index beef2f216..d8307386b 100644 --- a/src/modules/sapart.c +++ b/src/modules/sapart.c @@ -52,7 +52,7 @@ MOD_UNLOAD() return MOD_SUCCESS; } -void log_sapart(Client *client, Client *target, char *channels, char *comment) +static void log_sapart(Client *client, Client *target, char *channels, char *comment) { if (comment) { @@ -111,13 +111,12 @@ CMD_FUNC(cmd_sapart) return; } - /* Broadcast */ + /* Broadcast so other servers can log it appropriately as an SAPART */ if (parv[3]) sendto_server(client, 0, 0, recv_mtags, ":%s SAPART %s %s :%s", client->id, target->id, parv[2], comment); else sendto_server(client, 0, 0, recv_mtags, ":%s SAPART %s %s", client->id, target->id, parv[2]); - /* Relay it on, if it's not my target */ if (!MyUser(target)) { log_sapart(client, target, parv[2], comment);