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;
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;
}
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)
for (i=1; i<argc; i++) {
dict_remove(opserv_nick_based_alerts, argv[i]);
dict_remove(opserv_channel_alerts, argv[i]);
- if (dict_remove(opserv_user_alerts, argv[i]))
- reply("OSMSG_REMOVED_ALERT", argv[i]);
+ dict_remove(opserv_account_alerts, argv[i]);
+ if (dict_remove(opserv_user_alerts, argv[i]))
+ reply("OSMSG_REMOVED_ALERT", argv[i]);
else
- reply("OSMSG_NO_SUCH_ALERT", argv[i]);
+ reply("OSMSG_NO_SUCH_ALERT", argv[i]);
}
return 1;
}
dict_set_free_keys(opserv_chan_warn, free);
dict_set_free_data(opserv_chan_warn, free);
/* set up opserv_user_alerts */
+ dict_delete(opserv_account_alerts);
+ opserv_account_alerts = dict_new();
dict_delete(opserv_channel_alerts);
opserv_channel_alerts = dict_new();
dict_delete(opserv_nick_based_alerts);
unreg_del_user_func(opserv_user_cleanup);
dict_delete(opserv_hostinfo_dict);
dict_delete(opserv_nick_based_alerts);
+ dict_delete(opserv_account_alerts);
dict_delete(opserv_channel_alerts);
dict_delete(opserv_user_alerts);
for (nn=0; nn<ArrayLength(level_strings); ++nn)