keep in sync with OGN upstream (SVN-325)
authorpk910 <philipp@zoelle1.de>
Thu, 28 Jun 2012 06:48:26 +0000 (08:48 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 28 Jun 2012 06:48:26 +0000 (08:48 +0200)
ircd/s_user.c

index 53cebf2602df7e646dd136b4238b39635972a014..9f45018041e994d00f334dcf0687ff8283baa4d5 100644 (file)
@@ -1069,6 +1069,25 @@ hide_hostmask(struct Client *cptr, unsigned int flag)
     else {
         SetDelayedJoin(chan);
     }
+    
+    /*
+    * Check if the client is actually overriding a ban with the
+    * mask change, if so, kick him out of the channel.
+    * We have to proceed that way to ensure data consistency (join + kick)
+    */
+    if (find_ban(cptr, chan->channel->banlist)) {
+      /* Silentely kick in case of delayed join */
+      if (chan->channel->mode.mode & MODE_DELJOINS) {
+        sendcmdto_one(&his, CMD_KICK, cptr, "%H %C :Ban override", chan->channel, cptr);
+        CheckDelayedJoins(chan->channel);
+        
+      } else {
+        /* Otherwise publicly kick */
+        sendcmdto_serv_butone(&me, CMD_KICK, NULL, "%H %C :Ban override", chan->channel, cptr);
+        sendcmdto_channel_butserv_butone(&his, CMD_KICK, chan->channel, NULL, 0, "%H %C :Ban override", chan->channel, cptr);
+        make_zombie(chan, cptr, &me, &me, chan->channel);
+      }
+    }
   }
   return 0;
 }