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

Merge branch 'ducch-139-mmode-botbitch' into next

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

Conflicts:
	doc/UPDATES
Bryan Drewery 15 лет назад
Родитель
Сommit
75106a81c9
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

@@ -3,6 +3,7 @@ next
   * When 'mdop' protection is on, re-op all previously opped clients automatically.
   * When 'mdop' protection is on, re-op all previously opped clients automatically.
   * When 'mop' protection is on, deop all previously regular clients automatically.
   * When 'mop' protection is on, deop all previously regular clients automatically.
   * Properly honor exemptions when kicking matched RBL clients
   * Properly honor exemptions when kicking matched RBL clients
+  * Added botbitch to mmode (fixes #139)
 
 
 1.3.2 - http://wraith.botpack.net/milestone/1.3.2
 1.3.2 - http://wraith.botpack.net/milestone/1.3.2
   * Add an extra 2 second delay before releasing nick to aide in syncing and time to type /nick
   * Add an extra 2 second delay before releasing nick to aide in syncing and time to type /nick

+ 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);