[srvx-commits] CVS: services/src mod-snoop.c,1.18,1.19
Brought to you by:
entrope
From: Entrope <en...@us...> - 2003-11-15 04:01:33
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv17635/src Modified Files: mod-snoop.c Log Message: fix the mod-snoop loss of config data on rehash show NICK change arguments in proper order Index: mod-snoop.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** mod-snoop.c 19 Aug 2003 22:56:59 -0000 1.18 --- mod-snoop.c 15 Nov 2003 04:00:55 -0000 1.19 *************** *** 53,64 **** const char *snoop_module_deps[] = { NULL }; #define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS) #define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now)) static void ! snoop_nick_change(struct userNode *user, const char *new_nick) { if (!snoop_cfg.enabled) return; UPDATE_TIMESTAMP(); ! SNOOP("$bNICK$b change %s -> %s", user->nick, new_nick); } --- 53,67 ---- const char *snoop_module_deps[] = { NULL }; + static int finalized; + int snoop_finalize(void); + #define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS) #define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now)) static void ! snoop_nick_change(struct userNode *user, const char *old_nick) { if (!snoop_cfg.enabled) return; UPDATE_TIMESTAMP(); ! SNOOP("$bNICK$b change %s -> %s", old_nick, user->nick); } *************** *** 128,132 **** char *str; - memset(&snoop_cfg, 0, sizeof(snoop_cfg)); node = conf_get_data("modules/snoop", RECDB_OBJECT); if (!node) return; --- 131,134 ---- *************** *** 138,141 **** --- 140,144 ---- snoop_cfg.show_bursts = str ? enabled_string(str) : 0; snoop_cfg.enabled = 1; + if (finalized) snoop_finalize(); } *************** *** 168,171 **** --- 171,175 ---- char *str; + finalized = 1; node = conf_get_data("modules/snoop", RECDB_OBJECT); if (!node) return 0; |