소스 검색

Merge branch 'ducch-139-mmode-botbitch'

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

Conflicts:
	doc/UPDATES
Bryan Drewery 15 년 전
부모
커밋
e258605014
3개의 변경된 파일18개의 추가작업 그리고 10개의 파일을 삭제
  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)
   * cmd_mns_user now accepts multiple users (fixes #77)
   * Permanent owners can no longer be removed via cmd_mns_user
   * Permanent owners can no longer be removed via cmd_mns_user
   * Fix +take clearing -fastop (fixes #371)
   * Fix +take clearing -fastop (fixes #371)
+  * Added botbitch to mmode (fixes #139)
 
 
 1.3.1 - http://wraith.botpack.net/milestone/1.3.1
 1.3.1 - http://wraith.botpack.net/milestone/1.3.1
   * Fix crash related to slowpart
   * 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",
    Performs an action on the party line. This appears as "* bryan is leaving",
    etc.
    etc.
 :leaf:mmode:
 :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, 
    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.
    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
      $bd$b = $bnon-ops.$b
      $br$b = $bregulars (-ov).$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 
      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);
   char *mode = newsplit(&par);
   if (strlen(mode) > 2 || !strchr("+-", mode[0]) || !par[0]) {
   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");
     dprintf(idx, "Ie. mmode -o #chan a\n");
     return;
     return;
   }
   }
@@ -651,7 +651,7 @@ static void cmd_mmode(int idx, char *par)
     }
     }
   }
   }
   if (!chan || !chname || !chname[0]) {
   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");
     dprintf(idx, "Ie. mmode -o #chan a\n");
     return;
     return;
   }
   }
@@ -659,7 +659,7 @@ static void cmd_mmode(int idx, char *par)
   char *who = newsplit(&par);
   char *who = newsplit(&par);
 
 
   if (strlen(who) > 1 || !strchr("aovdr", who[0])) {
   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, "Ie. mmode -o #chan a\n");
     dprintf(idx, "a = all.\n");
     dprintf(idx, "a = all.\n");
     dprintf(idx, "o = ops.\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;
   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]) {
   while (par && par[0]) {
     char *p = newsplit(&par);
     char *p = newsplit(&par);
@@ -766,6 +766,8 @@ static void cmd_mmode(int idx, char *par)
       }
       }
     } else if (!strncasecmp(p, "bitch", 5)) {
     } else if (!strncasecmp(p, "bitch", 5)) {
       bitch = 1;
       bitch = 1;
+    } else if (!strncasecmp(p, "botbitch", 8)) {
+      botbitch = 1;
     } else if (!strncasecmp(p, "simul", 5)) {
     } else if (!strncasecmp(p, "simul", 5)) {
       simul = 1;
       simul = 1;
     } else if (!strncasecmp(p, "local", 5)) {
     } else if (!strncasecmp(p, "local", 5)) {
@@ -953,6 +955,10 @@ static void cmd_mmode(int idx, char *par)
     chan->status |= CHAN_BITCH;
     chan->status |= CHAN_BITCH;
     do_chanset(NULL, chan, "+bitch", DO_LOCAL | DO_NET);
     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(targets);
   free(overlaps);
   free(overlaps);
   free(chanbots);
   free(chanbots);