Procházet zdrojové kódy

Merge branch '39-dynamic-roles' into next

* 39-dynamic-roles:
  Add more docs about roles
  cmd_roles: Add some sanity

Conflicts:
	doc/UPDATES
Bryan Drewery před 12 roky
rodič
revize
8b7527762c
2 změnil soubory, kde provedl 17 přidání a 1 odebrání
  1. 7 1
      doc/UPDATES
  2. 10 0
      src/mod/irc.mod/cmdsirc.c

+ 7 - 1
doc/UPDATES

@@ -3,7 +3,13 @@ next
   * Properly honor exemptions when kicking matched RBL clients
   * Properly honor exemptions when kicking matched RBL clients
   * Fix LASTON not being shared
   * Fix LASTON not being shared
   * Remove channel limit when limitraise is disabled (#77)
   * Remove channel limit when limitraise is disabled (#77)
-  * Add cmd_roles (leaf only) to display roles for a channel.
+  * Wraith now automatically assigns roles to bots for channels, no longer
+    requiring manually assigning them with flags +flry for flood, limit,
+    resolve, auto-voice, auto-op. These roles are decentralized and per-chan
+    such that net-splits and botnet-splits and multiple groups in 1 chan
+    will properly assign roles out to bots to not cause overlap. Only leaf
+    bots know which bots have which roles. (#39)
+  * Add cmd_roles (leaf only) to display roles for a channel. (#39)
 
 
 maint
 maint
   * Read in /etc/hosts on startup
   * Read in /etc/hosts on startup

+ 10 - 0
src/mod/irc.mod/cmdsirc.c

@@ -1434,6 +1434,16 @@ static void cmd_roles(int idx, char *par)
 
 
   putlog(LOG_CMDS, "*", "#%s# (%s) roles", dcc[idx].nick, chan->dname);
   putlog(LOG_CMDS, "*", "#%s# (%s) roles", dcc[idx].nick, chan->dname);
 
 
+  if (!channel_active(chan)) {
+    dprintf(idx, "I'm not on %s right now!\n", chan->dname);
+    return;
+  }
+
+  if (chan->bot_roles->size() == 0) {
+    dprintf(idx, "Roles for %s are not yet calculated.\n", chan->dname);
+    return;
+  }
+
   dprintf(idx, "Roles for %s:\n", chan->dname);
   dprintf(idx, "Roles for %s:\n", chan->dname);
 
 
   /* Advertise roles */
   /* Advertise roles */