]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/channel.c
Implement channel mode "Q" and user mode "q"
[ngircd-alex.git] / src / ngircd / channel.c
index 10b05405b5ad50b0ebb464d1c9ce5139fc4d12ae..c679daeb9a08cbee79ae2cd48150318959cf8c08 100644 (file)
@@ -327,6 +327,17 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name,
        }
 
        if(Client_Type(Peer) == CLIENT_USER) {
+               /* Channel mode 'Q' and user mode 'q' on target: nobody but
+                * IRC Operators and servers can kick the target user */
+               if ((strchr(Channel_Modes(chan), 'Q')
+                   || Client_HasMode(Target, 'q'))
+                   && !Client_HasMode(Origin, 'o')) {
+                       IRC_WriteStrClient(Origin, ERR_KICKDENY_MSG,
+                                          Client_ID(Origin), Name,
+                                          Client_ID(Target));
+                       return;
+               }
+
                /* Check if client has the rights to kick target */
                ptr = Channel_UserModes(chan, Peer);
                target_modes = Channel_UserModes(chan, Target);