Ver Fonte

* Changed some if (localhub) to if (conf.bot->localhub)

svn: 1788
Bryan Drewery há 21 anos atrás
pai
commit
ee3dd82b99
5 ficheiros alterados com 15 adições e 18 exclusões
  1. 1 1
      src/botnet.c
  2. 1 1
      src/chanprog.c
  3. 2 2
      src/cmds.c
  4. 6 6
      src/main.c
  5. 5 8
      src/mod/update.mod/update.c

+ 1 - 1
src/botnet.c

@@ -609,7 +609,7 @@ void tell_bottree(int idx)
 
 
   if (bot_hublevel(conf.bot->u) < 999)
   if (bot_hublevel(conf.bot->u) < 999)
     color_str = (char *) YELLOW(idx);
     color_str = (char *) YELLOW(idx);
-  else if (localhub)
+  else if (conf.bot->localhub)
     color_str = (char *) RED(idx);
     color_str = (char *) RED(idx);
   else
   else
     color_str = (char *) NULL;
     color_str = (char *) NULL;

+ 1 - 1
src/chanprog.c

@@ -281,7 +281,7 @@ void tell_verbose_status(int idx)
 
 
   i = count_users(userlist);
   i = count_users(userlist);
   dprintf(idx, "I am %s, running %s:  %d user%s\n", conf.bot->nick, ver, i, i == 1 ? "" : "s");
   dprintf(idx, "I am %s, running %s:  %d user%s\n", conf.bot->nick, ver, i, i == 1 ? "" : "s");
-  if (localhub)
+  if (conf.bot->localhub)
     dprintf(idx, "I am a localhub.\n");
     dprintf(idx, "I am a localhub.\n");
 #ifdef HUB
 #ifdef HUB
   if (isupdatehub())
   if (isupdatehub())

+ 2 - 2
src/cmds.c

@@ -912,7 +912,7 @@ static void cmd_update(int idx, char *par)
 {
 {
   putlog(LOG_CMDS, "*", "#%s# update %s", dcc[idx].nick, par);
   putlog(LOG_CMDS, "*", "#%s# update %s", dcc[idx].nick, par);
 #ifdef LEAF
 #ifdef LEAF
-  if (!localhub) {
+  if (!conf.bot->localhub) {
     dprintf(idx, "Please use '%s%s%s' for this login/shell.\n", RED(idx), conf.localhub, COLOR_END(idx));
     dprintf(idx, "Please use '%s%s%s' for this login/shell.\n", RED(idx), conf.localhub, COLOR_END(idx));
     return;
     return;
   }
   }
@@ -1734,7 +1734,7 @@ static void cmd_sha1(int idx, char *par)
 
 
 static void cmd_conf(int idx, char *par)
 static void cmd_conf(int idx, char *par)
 {
 {
-  if (!localhub) {
+  if (!conf.bot->localhub) {
     dprintf(idx, "Please use '%s%s%s' for this login/shell.\n", RED(idx), conf.localhub, COLOR_END(idx));
     dprintf(idx, "Please use '%s%s%s' for this login/shell.\n", RED(idx), conf.localhub, COLOR_END(idx));
     return;
     return;
   }
   }

+ 6 - 6
src/main.c

@@ -419,7 +419,7 @@ void core_10secondly()
     check_trace(0);
     check_trace(0);
 
 
 #ifdef LEAF
 #ifdef LEAF
-  if (localhub) {
+  if (conf.bot->localhub) {
 #endif /* LEAF */
 #endif /* LEAF */
     check_promisc();
     check_promisc();
 
 
@@ -620,7 +620,7 @@ static void startup_checks(int hack) {
 
 
   fillconf(&conf);
   fillconf(&conf);
 #ifdef LEAF
 #ifdef LEAF
-  if (localhub && !used_B) {
+  if (conf.bot->localhub && !used_B) {
     if (do_killbot[0]) {
     if (do_killbot[0]) {
       const char *what = (kill_sig == SIGKILL ? "kill" : "restart");
       const char *what = (kill_sig == SIGKILL ? "kill" : "restart");
 
 
@@ -651,7 +651,7 @@ static void startup_checks(int hack) {
       exit(0); /* our job is done! */
       exit(0); /* our job is done! */
     }
     }
   }
   }
-  if (!localhub)		/* only clear conf on NON localhubs, we need it for cmd_conf */
+  if (!conf.bot->localhub)		/* only clear conf on NON localhubs, we need it for cmd_conf */
     free_conf();
     free_conf();
 #endif /* LEAF */
 #endif /* LEAF */
 }
 }
@@ -778,7 +778,7 @@ printf("out: %s\n", out);
   /* Check and load conf file */
   /* Check and load conf file */
   startup_checks(0);
   startup_checks(0);
 
 
-  if ((localhub && !updating) || !localhub) {
+  if ((conf.bot->localhub && !updating) || !conf.bot->localhub) {
     if ((conf.bot->pid > 0) && conf.bot->pid_file) {
     if ((conf.bot->pid > 0) && conf.bot->pid_file) {
       sdprintf("%s is already running, pid: %d", conf.bot->nick, conf.bot->pid);
       sdprintf("%s is already running, pid: %d", conf.bot->nick, conf.bot->pid);
       exit(1);
       exit(1);
@@ -814,7 +814,7 @@ printf("out: %s\n", out);
   trigger_cfg_changed();
   trigger_cfg_changed();
 
 
 #ifdef LEAF
 #ifdef LEAF
-  if (localhub) {
+  if (conf.bot->localhub) {
     sdprintf("I am localhub (%s)", conf.bot->nick);
     sdprintf("I am localhub (%s)", conf.bot->nick);
 #endif /* LEAF */
 #endif /* LEAF */
 #ifndef CYGWIN_HACKS
 #ifndef CYGWIN_HACKS
@@ -848,7 +848,7 @@ printf("out: %s\n", out);
 
 
 /*
 /*
     printf("  |- %-10s (%d)\n", conf.bot->nick, pid);
     printf("  |- %-10s (%d)\n", conf.bot->nick, pid);
-    if (localhub) {
+    if (conf.bot->localhub) {
       if (bots_ran)
       if (bots_ran)
         printf("  `- %d bots launched\n", bots_ran + 1);
         printf("  `- %d bots launched\n", bots_ran + 1);
       else
       else

+ 5 - 8
src/mod/update.mod/update.c

@@ -65,7 +65,7 @@ static void update_fileq(int idx, char *par)
   if (dcc[idx].status & STAT_GETTINGU) return;
   if (dcc[idx].status & STAT_GETTINGU) return;
 #ifdef LEAF
 #ifdef LEAF
   if (updated) return;
   if (updated) return;
-  if (localhub) {
+  if (conf.bot->localhub) {
 #else
 #else
   if (!isupdatehub()) {
   if (!isupdatehub()) {
 #endif /* LEAF */
 #endif /* LEAF */
@@ -165,19 +165,16 @@ static botcmd_t C_update[] =
 
 
 static void got_nu(char *botnick, char *code, char *par)
 static void got_nu(char *botnick, char *code, char *par)
 {
 {
-  if (!par || !*par) 
+  if (!par || !*par || updated) 
     return;
     return;
 #ifdef LEAF
 #ifdef LEAF
-  if (!conf.bot->u || !userlist || !get_user_by_handle(userlist, botnick))	/* probably still getting userfile */
-    return;
-
-  if (tandbot && tandbot->bot && !strcmp(tandbot->bot, botnick)) /* dont listen to our uplink.. use normal upate system.. */
+  if (!conf.bot->localhub)
     return;
     return;
 
 
-  if (!localhub)
+  if (!conf.bot->u || !userlist || !get_user_by_handle(userlist, botnick))	/* probably still getting userfile */
     return;
     return;
 
 
-  if (localhub && updated)
+  if (tandbot && tandbot->bot && !strcmp(tandbot->bot, botnick)) /* dont listen to our uplink.. use normal upate system.. */
     return;
     return;
 #endif /* LEAF */
 #endif /* LEAF */