}
static void
-snoop_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle)) {
+snoop_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle), UNUSED_ARG(void *extra)) {
if (!snoop_cfg.enabled) return;
if (user->uplink->burst && !snoop_cfg.show_bursts) return;
if (user->handle_info) {
}
static void
-snoop_user_mode(struct userNode *user, const char *mode_change) {
+snoop_user_mode(struct userNode *user, const char *mode_change, UNUSED_ARG(void *extra)) {
if (!snoop_cfg.enabled) return;
if (user->uplink->burst && !snoop_cfg.show_bursts) return;
if (!mode_change[1]) return; /* warning there has to be atleast one char in the buffer */
}
static void
-snoop_channel_mode(struct userNode *who, struct chanNode *channel, char **modes, unsigned int argc)
+snoop_channel_mode(struct userNode *who, struct chanNode *channel, char **modes, unsigned int argc, UNUSED_ARG(void *extra))
{
if (!snoop_cfg.enabled) return;
if(who) {
static void
snoop_conf_read(void) {
dict_t node;
- char *str;
+ char *str, *modes;
node = conf_get_data("modules/snoop", RECDB_OBJECT);
if (!node)
return;
str = database_get_data(node, "channel", RECDB_QSTRING);
+ modes = database_get_data(node, "channel_modes", RECDB_QSTRING);
if (!str)
return;
- snoop_cfg.channel = AddChannel(str, now, "+sntim", NULL, NULL);
+ snoop_cfg.channel = AddChannel(str, now, (modes ? modes : "+sntim"), NULL, NULL);
if (!snoop_cfg.channel)
return;
str = database_get_data(node, "show_bursts", RECDB_QSTRING);
}
void
-snoop_cleanup(void) {
+snoop_cleanup(UNUSED_ARG(void *extra)) {
snoop_cfg.enabled = 0;
unreg_del_user_func(snoop_del_user, NULL);
}
int
snoop_init(void) {
- reg_exit_func(snoop_cleanup);
+ reg_exit_func(snoop_cleanup, NULL);
conf_register_reload(snoop_conf_read);
reg_nick_change_func(snoop_nick_change, NULL);
- reg_join_func(snoop_join, NULL);
+ reg_join_func_pos(snoop_join, NULL, EH_ADD_HEAD);
reg_part_func(snoop_part, NULL);
- reg_kick_func(snoop_kick);
- reg_new_user_func(snoop_new_user, NULL);
+ reg_kick_func(snoop_kick, NULL);
+ reg_new_user_func_pos(snoop_new_user, NULL, EH_ADD_HEAD);
reg_del_user_func(snoop_del_user, NULL);
- reg_auth_func(snoop_auth);
- reg_channel_mode_func(snoop_channel_mode);
- reg_user_mode_func(snoop_user_mode);
+ reg_auth_func(snoop_auth, NULL);
+ reg_channel_mode_func(snoop_channel_mode, NULL);
+ reg_user_mode_func(snoop_user_mode, NULL);
reg_oper_func(snoop_oper, NULL);
return 1;