send KICK's only to users seeing the leaving user on MODE_AUDITORIUM channels
authorpk910 <philipp@zoelle1.de>
Sat, 2 Jul 2011 15:16:47 +0000 (17:16 +0200)
committerpk910 <philipp@zoelle1.de>
Sat, 2 Jul 2011 15:16:47 +0000 (17:16 +0200)
ircd/m_kick.c

index c6595d4c639cff4e5c898df25e7bde0707b30416..bccd7416296e5681da35c31abebae2489816cb2e 100644 (file)
@@ -167,9 +167,13 @@ int m_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     sendcmdto_one(who, CMD_JOIN, sptr, "%H", chptr);
     sendcmdto_one(sptr, CMD_KICK, sptr, "%H %C :%s", chptr, who, comment);
     CheckDelayedJoins(chptr);
+  } else if((member->channel->mode.mode & MODE_AUDITORIUM) && !IsVoicedOrOpped(member)) {
+    /* send the kick to ops only. */
+    if (MyUser(who))
+      sendcmdto_one(sptr, CMD_KICK, who, "%H %C :%s", chptr, who, comment);
+    sendcmdto_channel_butserv_butone(sptr, CMD_KICK, chptr, NULL, SKIP_NONOPS, "%H %C :%s", chptr, who, comment);
   } else
-    sendcmdto_channel_butserv_butone(sptr, CMD_KICK, chptr, NULL, 0, "%H %C :%s", chptr, who,
-                                     comment);
+    sendcmdto_channel_butserv_butone(sptr, CMD_KICK, chptr, NULL, 0, "%H %C :%s", chptr, who, comment);
 
   make_zombie(member, who, cptr, sptr, chptr);
 
@@ -269,6 +273,11 @@ int ms_kick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
         if (MyUser(who))
           sendcmdto_one(IsServer(sptr) ? &his : sptr, CMD_KICK,
                         who, "%H %C :%s", chptr, who, comment);
+      }  else if((member->channel->mode.mode & MODE_AUDITORIUM) && !IsVoicedOrOpped(member)) {
+        /* send the kick to ops only. */
+        if (MyUser(who))
+          sendcmdto_one(IsServer(sptr) ? &his : sptr, CMD_KICK, who, "%H %C :%s", chptr, who, comment);
+        sendcmdto_channel_butserv_butone(IsServer(sptr) ? &his : sptr, CMD_KICK, chptr, NULL, SKIP_NONOPS, "%H %C :%s", chptr, who, comment);
       } else {
         sendcmdto_channel_butserv_butone(IsServer(sptr) ? &his : sptr, CMD_KICK,
                                          chptr, NULL, 0, "%H %C :%s", chptr, who,