Przeglądaj źródła

* Port [3220] to 1.2.14
* Fix localhub choosing logic
* Fix conf.localhub not being set to NULL (initial value)



svn: 3221

Bryan Drewery 19 lat temu
rodzic
commit
a1372d2318
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      src/conf.c

+ 5 - 4
src/conf.c

@@ -354,6 +354,7 @@ init_conf()
   conf.bots = NULL;
   conf.bot = NULL;
 
+  conf.localhub = NULL;
   conf.watcher = 0;
 #ifdef CYGWIN_HACKS
   conf.autocron = 0;
@@ -576,11 +577,11 @@ conf_addbot(char *nick, char *ip, char *host, char *ip6)
 
   /* not a hub 
    AND
-   * no bots added yet (first bot) yet, not disabled.
-   OR
-   * bots already listed but we dont have a localhub yet, so we're it!
+    * no bots added yet (first bot) yet, not disabled.
+    OR
+    * bots already listed but we dont have a localhub yet, so we're it!
    */
-  if (!bot->hub && ((!conf.bots && !bot->disabled) || (conf.bots && !conf.localhub))) {
+  if (!conf.localhub && !bot->hub && !bot->disabled) {
     bot->localhub = 1;          /* first bot */
     conf.localhub = strdup(bot->nick);
   }