Просмотр исходного кода

* Check for removed server after .set as well

Bryan Drewery 16 лет назад
Родитель
Сommit
38c87bc9b6
2 измененных файлов с 6 добавлено и 0 удалено
  1. 4 0
      src/set.c
  2. 2 0
      src/userent.c

+ 4 - 0
src/set.c

@@ -655,6 +655,7 @@ void init_vars()
 }
 }
 
 
 /* This is used to parse (GLOBAL) userfile var lines and changes via .set from a remote hub */
 /* This is used to parse (GLOBAL) userfile var lines and changes via .set from a remote hub */
+// per-bot is set in userent.c: set_gotshare
 void var_userfile_share_line(char *line, int idx, bool share)
 void var_userfile_share_line(char *line, int idx, bool share)
 {
 {
   char *name = newsplit(&line);
   char *name = newsplit(&line);
@@ -671,6 +672,9 @@ void var_userfile_share_line(char *line, int idx, bool share)
   if (share && (conf.bot->hub || conf.bot->localhub))
   if (share && (conf.bot->hub || conf.bot->localhub))
     botnet_send_var_broad(idx, var);
     botnet_send_var_broad(idx, var);
   set_noshare = 0;
   set_noshare = 0;
+
+  if (!conf.bot->hub && !strncmp(var->name, "servers", 7))
+    check_removed_server();
 }
 }
 
 
 static const char *var_get_bot_data(struct userrec *u, const char *name)
 static const char *var_get_bot_data(struct userrec *u, const char *name)

+ 2 - 0
src/userent.c

@@ -351,6 +351,8 @@ static bool set_gotshare(struct userrec *u, struct user_entry *e, char *buf, int
     var_set_by_name(conf.bot->nick, name, buf[0] ? buf : NULL);
     var_set_by_name(conf.bot->nick, name, buf[0] ? buf : NULL);
     set_noshare = 0;
     set_noshare = 0;
   /* var_set_by_name() called set_user(), no need to do it again... */
   /* var_set_by_name() called set_user(), no need to do it again... */
+    if (!conf.bot->hub && !strncmp(name, "servers", 7))
+      check_removed_server();
   } 
   } 
   /* not else if as the hub might have gotten a botset for itself */
   /* not else if as the hub might have gotten a botset for itself */
   if (conf.bot->hub || conf.bot->localhub) {
   if (conf.bot->hub || conf.bot->localhub) {