ソースを参照

* Port [3182] to 1.2.14
* Fix bug with bots not retaining flags over share. (fixes #334)


svn: 3183

Bryan Drewery 19 年 前
コミット
65f8d2881c
3 ファイル変更13 行追加0 行削除
  1. 1 0
      doc/UPDATES
  2. 8 0
      src/mod/share.mod/share.c
  3. 4 0
      src/users.c

+ 1 - 0
doc/UPDATES

@@ -4,6 +4,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 
 1.2.14 - http://wraith.shatow.net/milestone/1.2.14
 * Fix another bug in shell functions. (fixes #321)
+* Fix bug with bots not retaining flags over share. (fixes #334)
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 8 - 0
src/mod/share.mod/share.c

@@ -358,6 +358,10 @@ share_chattr(int idx, char *par)
         if (par[0] && cst) {
           fr.match = FR_CHAN;
           fr2.match = FR_CHAN;
+          if (u->bot) {
+            fr.match |= FR_BOT; 
+            fr2.match |= FR_BOT;
+          }
           break_down_flags(atr, &fr, 0);
           get_user_flagrec(u, &fr2, par);
           set_user_flagrec(u, &fr, par);
@@ -374,6 +378,8 @@ share_chattr(int idx, char *par)
           get_user_flagrec(dcc[idx].user, &fr, 0);
           /* Don't let bot flags be altered */
           ofl = fr.global;
+          if (u->bot)
+            fr.match |= FR_BOT;
           break_down_flags(atr, &fr, 0);
           fr.global = sanity_check(fr.global, u->bot);
           set_user_flagrec(u, &fr, 0);
@@ -466,6 +472,8 @@ share_newuser(int idx, char *par)
       fr.global = 0;
 
       fr.match = FR_GLOBAL;
+      if (isbot)
+        fr.match |= FR_BOT;
       break_down_flags(par, &fr, NULL);
 
       /* If user already exists, ignore command */

+ 4 - 0
src/users.c

@@ -465,6 +465,10 @@ void tell_users_match(int idx, char *mtch, int start, int limit, char *chname, i
     dprintf(idx, "(skipping first %d)\n", start - 1);
   if (strchr("+-&|", *mtch)) {
     user.match = pls.match = FR_GLOBAL | FR_CHAN;
+    if (isbot) {
+      user.match |= FR_BOT;
+      pls.match |= FR_BOT;
+    }
     break_down_flags(mtch, &pls, &mns);
     mns.match = pls.match ^ (FR_AND | FR_OR);
     if (!mns.global && !mns.chan) {