connect Watchdog before loading saved data (channels)
authorpk910 <philipp@zoelle1.de>
Thu, 21 Jul 2011 19:22:01 +0000 (21:22 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 21 Jul 2011 19:22:01 +0000 (21:22 +0200)
src/mod-watchdog.c

index 36b3ac57e5fe892cb952c5f4b04a3d8bfa60b352..4cfcd34e41be27687d52c552ab80941a74bbad90 100644 (file)
@@ -343,10 +343,6 @@ watchdog_init(void)
     dict_delete(chanlist);
     chanlist = dict_new();
     dict_set_free_data(chanlist, free_chanlist_entry);
-    
-    conf_register_reload(watchdog_conf_read);
-    reg_exit_func(watchdog_cleanup);
-    saxdb_register("Watchdog", watchdog_saxdb_read, watchdog_saxdb_write);
 
     const char *nick, *modes;
     if((nick = conf_get_data("modules/watchdog/nick", RECDB_QSTRING))) {
@@ -357,6 +353,10 @@ watchdog_init(void)
         reg_allchanmsg_func(watchdog, watchdog_channel_message);
     }
 
+    conf_register_reload(watchdog_conf_read);
+    reg_exit_func(watchdog_cleanup);
+    saxdb_register("Watchdog", watchdog_saxdb_read, watchdog_saxdb_write);
+
     watchdog_module = module_register("Watchdog", MS_LOG, "mod-watchdog.help", NULL);
     modcmd_register(watchdog_module, "addbad", cmd_addbad, 1, MODCMD_REQUIRE_AUTHED, "flags", "+oper", NULL);
     modcmd_register(watchdog_module, "delbad", cmd_delbad, 1, MODCMD_REQUIRE_AUTHED, "flags", "+oper", NULL);