Răsfoiți Sursa

Merge branch 'ducch-139-mmode-botbitch'

* ducch-139-mmode-botbitch:
  * Update docs
  * Added botbitch to mmode (fixes #139)

Conflicts:
	doc/UPDATES
Bryan Drewery 15 ani în urmă
părinte
comite
e258605014
3 a modificat fișierele cu 18 adăugiri și 10 ștergeri
  1. 1 0
      doc/UPDATES
  2. 7 6
      doc/help.txt
  3. 10 4
      src/mod/irc.mod/cmdsirc.c

+ 1 - 0
doc/UPDATES

@@ -14,6 +14,7 @@
   * cmd_mns_user now accepts multiple users (fixes #77)
   * Permanent owners can no longer be removed via cmd_mns_user
   * Fix +take clearing -fastop (fixes #371)
+  * Added botbitch to mmode (fixes #139)
 
 1.3.1 - http://wraith.botpack.net/milestone/1.3.1
   * Fix crash related to slowpart

+ 7 - 6
doc/help.txt

@@ -1307,7 +1307,7 @@ See also: randstring, sha1, sha256, hash, encrypt, encrypt_fish, decrypt, decryp
    Performs an action on the party line. This appears as "* bryan is leaving",
    etc.
 :leaf:mmode:
-###  $bmmode$b <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [simul] [local]
+###  $bmmode$b <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [botbitch] [simul] [local]
    For those of us who do not wish to be rocket scientists in the mass mode department, 
    a simple '%dmmode -o #channel o' will suffice.
  
@@ -1324,11 +1324,12 @@ See also: randstring, sha1, sha256, hash, encrypt, encrypt_fish, decrypt, decryp
      $bd$b = $bnon-ops.$b
      $br$b = $bregulars (-ov).$b
  
-     $bbitch$b   - set +bitch after finished with mmode.
-     $bsimul$b   - Simulates the mmode. IE: Gives you a practice run, will show who 
-                   does what in the dcc chat window.
-     $blocal$b   - Modes will not be distributed: Ran on local bot only.
-                   Use this with caution, and do not expect good results.
+     $bbitch$b    - set +bitch after finished with mmode.
+     $bbotbitch$b - set +bitch after finished with mmode.
+     $bsimul$b    - Simulates the mmode. IE: Gives you a practice run, will show who
+                    does what in the dcc chat window.
+     $blocal$b    - Modes will not be distributed: Ran on local bot only.
+                    Use this with caution, and do not expect good results.
  
      =============================================================================
      don't bother setting the following options unless you REALLY know what you're 

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

@@ -618,7 +618,7 @@ static void cmd_mmode(int idx, char *par)
 {
   char *mode = newsplit(&par);
   if (strlen(mode) > 2 || !strchr("+-", mode[0]) || !par[0]) {
-    dprintf(idx, "Usage: mmode <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [simul] [local]\n");
+    dprintf(idx, "Usage: mmode <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [botbitch] [simul] [local]\n");
     dprintf(idx, "Ie. mmode -o #chan a\n");
     return;
   }
@@ -651,7 +651,7 @@ static void cmd_mmode(int idx, char *par)
     }
   }
   if (!chan || !chname || !chname[0]) {
-    dprintf(idx, "Usage: mmode <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [simul] [local]\n");
+    dprintf(idx, "Usage: mmode <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [botbitch] [simul] [local]\n");
     dprintf(idx, "Ie. mmode -o #chan a\n");
     return;
   }
@@ -659,7 +659,7 @@ static void cmd_mmode(int idx, char *par)
   char *who = newsplit(&par);
 
   if (strlen(who) > 1 || !strchr("aovdr", who[0])) {
-    dprintf(idx, "Usage: mmode <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [simul] [local]\n");
+    dprintf(idx, "Usage: mmode <(+|-)MODE> <#channel> <a|o|v|d|r> [bots=n] [alines=n] [slines=n] [overlap=n] [bitch] [botbitch] [simul] [local]\n");
     dprintf(idx, "Ie. mmode -o #chan a\n");
     dprintf(idx, "a = all.\n");
     dprintf(idx, "o = ops.\n");
@@ -716,7 +716,7 @@ static void cmd_mmode(int idx, char *par)
   }
 
   int force_bots = 0, force_alines = 0, force_slines = 0, force_overlap = 0;
-  bool bitch = 0, simul = 0, local = 0;
+  bool bitch = 0, botbitch = 0, simul = 0, local = 0;
 
   while (par && par[0]) {
     char *p = newsplit(&par);
@@ -766,6 +766,8 @@ static void cmd_mmode(int idx, char *par)
       }
     } else if (!strncasecmp(p, "bitch", 5)) {
       bitch = 1;
+    } else if (!strncasecmp(p, "botbitch", 8)) {
+      botbitch = 1;
     } else if (!strncasecmp(p, "simul", 5)) {
       simul = 1;
     } else if (!strncasecmp(p, "local", 5)) {
@@ -953,6 +955,10 @@ static void cmd_mmode(int idx, char *par)
     chan->status |= CHAN_BITCH;
     do_chanset(NULL, chan, "+bitch", DO_LOCAL | DO_NET);
   }
+  if (botbitch && !simul) {
+    chan->status |= CHAN_BOTBITCH;
+    do_chanset(NULL, chan, "+botbitch", DO_LOCAL | DO_NET);
+  }
   free(targets);
   free(overlaps);
   free(chanbots);