X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-channel.c;h=1014d3aa469f4b158b2e66842def42a66fba6878;hp=010be3520d42b42f366e3bdabde946334cc48957;hb=9f58418765576950983b4a95c4f5f71f068f424f;hpb=ef157715a00f565c8e17cf5618eb437b2df6d4bc diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index 010be352..1014d3aa 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2008 Alexander Barton (alex@barton.de) + * Copyright (c)2001-2010 Alexander Barton (alex@barton.de) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,7 +93,7 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, } channel_modes = Channel_Modes(chan); - if ((strchr(channel_modes, 'i')) && !is_invited) { + if (strchr(channel_modes, 'i') && !is_invited) { /* Channel is "invite-only" and client is not on invite list */ IRC_WriteStrClient(Client, ERR_INVITEONLYCHAN_MSG, Client_ID(Client), channame); @@ -108,7 +108,7 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, return false; } - if ((strchr(channel_modes, 'l')) && + if (strchr(channel_modes, 'l') && (Channel_MaxUsers(chan) <= Channel_MemberCount(chan))) { /* There are more clints joined to this channel than allowed */ IRC_WriteStrClient(Client, ERR_CHANNELISFULL_MSG, @@ -116,6 +116,14 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, return false; } + if (strchr(channel_modes, 'z') && !Conn_UsesSSL(Client_Conn(Client))) { + /* Only "secure" clients are allowed, but clients doesn't + * use SSL encryption */ + IRC_WriteStrClient(Client, ERR_SECURECHANNEL_MSG, + Client_ID(Client), channame); + return false; + } + return true; }