]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-channel.c
Support individual channel keys for pre-defined channels.
[ngircd-alex.git] / src / ngircd / irc-channel.c
index 27414d38b5771666c402dba0a259018e6f6e06df..6c478c83927646f6b92d6cf385768dc02fe6620e 100644 (file)
@@ -89,10 +89,9 @@ join_allowed(CLIENT *Client, CLIENT *target, CHANNEL *chan,
        }
 
        /* Is the channel protected by a key? */
-       if (strchr(channel_modes, 'k') &&
-               strcmp(Channel_Key(chan), key ? key : ""))
-       {
-               IRC_WriteStrClient(Client, ERR_BADCHANNELKEY_MSG, Client_ID(Client), channame);
+       if (!Channel_CheckKey(chan, target, key ? key : "")) {
+               IRC_WriteStrClient(Client, ERR_BADCHANNELKEY_MSG,
+                                  Client_ID(Client), channame);
                return false;
        }
        /* Are there already too many members? */