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

* Port [3452] to 1.2.14
* Limit bots no longer set limit when 'chanmode -l' is set. (fixes #294)



svn: 3453

Bryan Drewery 19 лет назад
Родитель
Сommit
326500a9d0
3 измененных файлов с 10 добавлено и 4 удалено
  1. 1 0
      doc/UPDATES
  2. 4 0
      src/mod/irc.mod/irc.c
  3. 5 4
      src/mod/irc.mod/mode.c

+ 1 - 0
doc/UPDATES

@@ -49,6 +49,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Reformat CTCP logging. (fixes #358)
 * Cleanup cmd_userlist to list hubs/leafs/backups (fixes #363)
 * Bots will now cycle nicks on servers which claim their nick is invalid. (fixes #311)
+* Limit bots no longer set limit when 'chanmode -l' is set. (fixes #294)
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 4 - 0
src/mod/irc.mod/irc.c

@@ -1351,6 +1351,10 @@ raise_limit(struct chanset_t *chan)
   if (!chan || !me_op(chan))
     return;
 
+  /* Don't bother setting limit if the user has set a protect -l */
+  if (chan->mode_mns_prot & CHANLIMIT)
+    return;
+
   int nl = chan->channel.members + chan->limitraise;	/* new limit */
   int i = chan->limitraise >> 2;			/* DIV 4 */
   /* if the newlimit will be in the range made by these vars, dont change. */

+ 5 - 4
src/mod/irc.mod/mode.c

@@ -1334,7 +1334,7 @@ gotmode(char *from, char *msg)
                 }
               }
               chan->channel.maxmembers = 0;
-            } else {
+            } else {  /* + */
               if (mparam == '\0')
                 break;
               chan->channel.maxmembers = atoi(mparam);
@@ -1342,10 +1342,11 @@ gotmode(char *from, char *msg)
                 break;
               if (((reversing) &&
                    !(chan->mode_pls_prot & CHANLIMIT)) ||
-                  ((chan->mode_mns_prot & CHANLIMIT) && !glob_master(user) && !chan_master(user)))
+                  ((chan->mode_mns_prot & CHANLIMIT) && 
+                   !glob_bot(user) && !glob_master(user) && !chan_master(user)))
                 add_mode(chan, '-', 'l', "");
-              if ((chan->limit_prot != chan->channel.maxmembers) && (chan->mode_pls_prot & CHANLIMIT) && (chan->limit_prot != 0) &&     /* arthur2 */
-                  !glob_master(user) && !chan_master(user)) {
+              if ((chan->limit_prot != chan->channel.maxmembers) && (chan->mode_pls_prot & CHANLIMIT) && (chan->limit_prot != 0) && 
+                  !glob_bot(user) && !glob_master(user) && !chan_master(user)) {
                 simple_sprintf(s, "%d", chan->limit_prot);
                 add_mode(chan, '+', 'l', s);
               }