static const struct message_entry msgtab[] = {
{ "WDMSG_REGISTER_SUCCESS", "$b%s$b is now registered with %s." },
+ { "WDMSG_UNREG_SUCCESS", "$b%s$b is now unregistered." },
{ "WDMSG_NOT_REGISTERED", "$b%s$b is not registered with %s." },
{ "WDMSG_ALREADY_ADDED", "$b%s$b is already added. (ID: %s)" },
{ "WDMSG_BADWORD_ADDED", "added '$b%s$b' to the badword list with ID %s." },
#define BADACTION_KILL 2
#define BADACTION_GLINE 3
-#define WDMSG_BADWORD_ALERT "%s used badword '%s' in channel: %s"
+#define WDMSG_BADWORD_ALERT "%s used badword '%s' in channel: %s."
+#define WDMSG_REGISTER_SUCCESS "$b%s$b is now registered with %s by %s."
+#define WDMSG_UNREG_SUCCESS "$b%s$b is now unregistered by %s."
static struct {
const char *nick;
unsigned long ban_duration;
unsigned long gline_duration;
struct chanNode *alert_channel;
+ struct chanNode *oper_channel;
} watchdog_conf;
const char *watchdog_module_deps[] = { NULL };
static struct badword *add_badword(const char *badword_mask, unsigned int triggered, unsigned int action, unsigned int alert, const char *id);
#define watchdog_notice(target, format...) send_message(target , watchdog , ## format)
#define watchdog_debug(format...) do { if(watchdog_conf.alert_channel) send_channel_message(watchdog_conf.alert_channel , watchdog , ## format); } while(0)
+#define watchdog_oper_message(format...) do { if(watchdog_conf.oper_channel) send_channel_message(watchdog_conf.oper_channel , watchdog , ## format); } while(0)
static MODCMD_FUNC(cmd_addbad)
{
add_channel(channel->name);
reply("WDMSG_REGISTER_SUCCESS", channel->name, watchdog->nick);
+ watchdog_oper_message(WDMSG_REGISTER_SUCCESS, channel->name, watchdog->nick, user->handle_info->handle);
return 1;
}
DelChannelUser(watchdog, channel, reason, 0);
dict_remove(chanlist, channel->name);
reply("CSMSG_UNREG_SUCCESS", channel->name);
+ watchdog_oper_message(WDMSG_UNREG_SUCCESS, channel->name, user->handle_info->handle);
return 1;
} else {
reply("WDMSG_NOT_REGISTERED", channel->name, watchdog->nick);
str = database_get_data(conf_node, "punishment_reason", RECDB_QSTRING);
watchdog_conf.punishment_reason = (str ? str : "Your message contained a forbidden word.");
- str = database_get_data(conf_node, "alert_chan", RECDB_QSTRING);
+ str = database_get_data(conf_node, "alert_channel", RECDB_QSTRING);
if(str)
{
watchdog_conf.alert_channel = AddChannel(str, now, "+tinms", NULL);
watchdog_conf.alert_channel = NULL;
}
+ str = database_get_data(conf_node, "oper_channel", RECDB_QSTRING);
+ if(str)
+ {
+ watchdog_conf.oper_channel = AddChannel(str, now, "+tinms", NULL);
+ }
+ else
+ {
+ watchdog_conf.oper_channel = NULL;
+ }
}
static int