From b08752358c597459faadc8a937f2d6bcb88e683e Mon Sep 17 00:00:00 2001 From: ThiefMaster Date: Sat, 7 Apr 2007 20:06:24 +0200 Subject: [PATCH] Check account-based alerts when someone authenticates. --- src/opserv.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/opserv.c b/src/opserv.c index d6aedf5..eea1ada 100644 --- a/src/opserv.c +++ b/src/opserv.c @@ -266,6 +266,7 @@ static dict_t opserv_hostinfo_dict; /* data is struct opserv_hostinfo* */ static dict_t opserv_user_alerts; /* data is struct opserv_user_alert* */ static dict_t opserv_nick_based_alerts; /* data is struct opserv_user_alert* */ static dict_t opserv_channel_alerts; /* data is struct opserv_user_alert* */ +static dict_t opserv_account_alerts; /* data is struct opserv_user_alert* */ static struct module *opserv_module; static struct log_type *OS_LOG; static unsigned int new_user_flood; @@ -2595,6 +2596,8 @@ opserv_add_user_alert(struct userNode *req, const char *name, opserv_alert_react dict_insert(opserv_channel_alerts, name_dup, alert); if (alert->discrim->mask_nick) dict_insert(opserv_nick_based_alerts, name_dup, alert); + if (alert->discrim->accountmask || alert->discrim->authed != -1) + dict_insert(opserv_account_alerts, name_dup, alert); return alert; } @@ -3837,6 +3840,8 @@ opserv_staff_alert(struct userNode *user, UNUSED_ARG(struct handle_info *old_han send_channel_notice(opserv_conf.staff_auth_channel, opserv, IDENT_FORMAT" authed to %s account %s", IDENT_DATA(user), type, user->handle_info->handle); else send_channel_notice(opserv_conf.staff_auth_channel, opserv, "%s [%s@%s] authed to %s account %s", user->nick, user->ident, user->hostname, type, user->handle_info->handle); + + dict_foreach(opserv_account_alerts, alert_check_user, user); } static MODCMD_FUNC(cmd_log) @@ -3972,10 +3977,11 @@ static MODCMD_FUNC(cmd_delalert) for (i=1; i