Przeglądaj źródła

Always share '.set groups' to all bots.

Bryan Drewery 10 lat temu
rodzic
commit
0bac471498
2 zmienionych plików z 10 dodań i 5 usunięć
  1. 1 2
      doc/UPDATES.md
  2. 9 3
      src/userent.cc

+ 1 - 2
doc/UPDATES.md

@@ -1,5 +1,4 @@
-* Fix bots not tracking botset for other bots, which may be relevant for
-  them making decisions based on groups.
+* Fix bots not tracking groups for other bots.
 
 # maint
   * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.

+ 9 - 3
src/userent.cc

@@ -253,9 +253,15 @@ static bool set_set(struct userrec *u, struct user_entry *e, void *buf)
   }
   
   /* we will possibly free new below, so let's send the information to the botnet now */
-  if (!noshare && !set_noshare)
-    /* only share to pertinent bots */
-    shareout_prot(u, "c %s %s %s %s\n", e->type->name, u->handle, newxk->key, newxk->data ? newxk->data : "");
+  if (!noshare && !set_noshare) {
+    /* Always share groups to all bots. */
+    if (!strcmp(newxk->key, "groups")) {
+      shareout("c %s %s %s %s\n", e->type->name, u->handle, newxk->key, newxk->data ? newxk->data : "");
+    } else {
+      /* only share to pertinent bots */
+      shareout_prot(u, "c %s %s %s %s\n", e->type->name, u->handle, newxk->key, newxk->data ? newxk->data : "");
+    }
+  }
 
   /* unset and bail out if the new data is empty and the old doesn't exist, why'd we even get this change? */
   if (!old && (!newxk->data || !newxk->data[0])) {