diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/defines.h | 4 | ||||
| -rw-r--r-- | src/ngircd/irc-channel.c | 7 | ||||
| -rw-r--r-- | src/ngircd/irc-mode.c | 1 | ||||
| -rw-r--r-- | src/ngircd/messages.h | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/ngircd/defines.h b/src/ngircd/defines.h index 8f62279d..8db59e89 100644 --- a/src/ngircd/defines.h +++ b/src/ngircd/defines.h @@ -82,8 +82,8 @@ #define RECONNECT_DELAY 3 /* Time to delay re-connect attempts in seconds. */ -#define USERMODES "aciorswx" /* Supported user modes. */ -#define CHANMODES "biIklmnoOPstvz" /* Supported channel modes. */ +#define USERMODES "aciorRswx" /* Supported user modes. */ +#define CHANMODES "biIklmnoOPRstvz" /* Supported channel modes. */ #define CONNECTED true /* Internal status codes. */ #define DISCONNECTED false diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index 66b3eeb2..233e1731 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -137,6 +137,13 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, return false; } + if (strchr(channel_modes, 'R') && !strchr(Client_Modes(Client), 'R')) { + /* Only registered users are allowed! */ + IRC_WriteStrClient(Client, ERR_REGONLYCHANNEL_MSG, + Client_ID(Client), channame); + return false; + } + return true; } /* join_allowed */ diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index 3cceaeb8..ba44a3ba 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -479,6 +479,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) case 'i': /* Invite only */ case 'm': /* Moderated */ case 'n': /* Only members can write */ + case 'R': /* Registered users only */ case 's': /* Secret channel */ case 't': /* Topic locked */ case 'z': /* Secure connections only */ diff --git a/src/ngircd/messages.h b/src/ngircd/messages.h index 12791d23..78ac0689 100644 --- a/src/ngircd/messages.h +++ b/src/ngircd/messages.h @@ -120,6 +120,7 @@ #define ERR_CHANNELISFULL_MSG "471 %s %s :Cannot join channel (+l)" #define ERR_SECURECHANNEL_MSG "471 %s %s :Cannot join channel (+z)" #define ERR_OPONLYCHANNEL_MSG "471 %s %s :Cannot join channel (+O)" +#define ERR_REGONLYCHANNEL_MSG "471 %s %s :Cannot join channel (+R)" #define ERR_UNKNOWNMODE_MSG "472 %s: %c :is unknown mode char for %s" #define ERR_INVITEONLYCHAN_MSG "473 %s %s :Cannot join channel (+i)" #define ERR_BANNEDFROMCHAN_MSG "474 %s %s :Cannot join channel (+b)" |