Skip to content

Commit

Permalink
Added an option to prevent non-IRCops creating channels if the option…
Browse files Browse the repository at this point in the history
… is enabled
  • Loading branch information
jobe1986 committed May 1, 2014
1 parent 273d06c commit 66e8f3a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,4 +11,5 @@ ircu.tags
autom4te.cache
stamp-h1
include/patchlist.h
.orig

1 change: 1 addition & 0 deletions doc/example.conf
Expand Up @@ -1269,6 +1269,7 @@ features
# "CHMODE_m_NONICKCHANGE" = "TRUE";
# "CHMODE_r_NONICKCHANGE" = "TRUE";
# "SILENCE_CHANMSGS" = "TRUE";
# "CHANNEL_CREATE_IRCOPONLY" = "FALSE";
# "CHMODE_a" = "TRUE";
# "CHMODE_c" = "TRUE";
# "CHMODE_C" = "TRUE";
Expand Down
6 changes: 6 additions & 0 deletions doc/readme.features
Expand Up @@ -1273,6 +1273,12 @@ SILENCE_CHANMSGS
When enabled SILENCE masks are applied to channel messages as well as to private
messages.

CHANNEL_CREATE_IRCOPONLY
* Type: boolean
* Default: FALSE

When enabled only IRCops can create channels.

CHMODE_a
* Type: boolean
* Default: TRUE
Expand Down
1 change: 1 addition & 0 deletions include/ircd_features.h
Expand Up @@ -216,6 +216,7 @@ enum Feature {
FEAT_CHMODE_m_NONICKCHANGE,
FEAT_CHMODE_r_NONICKCHANGE,
FEAT_SILENCE_CHANMSGS,
FEAT_CHANNEL_CREATE_IRCOPONLY,

/* Extended channel modes */
FEAT_CHMODE_a,
Expand Down
1 change: 1 addition & 0 deletions ircd/ircd_features.c
Expand Up @@ -684,6 +684,7 @@ static struct FeatureDesc {
F_B(CHMODE_m_NONICKCHANGE, 0, 1, 0 ),
F_B(CHMODE_r_NONICKCHANGE, 0, 1, 0 ),
F_B(SILENCE_CHANMSGS, 0, 1, 0 ),
F_B(CHANNEL_CREATE_IRCOPONLY, 0, 0, 0 ),

/* Extended channel modes */
F_B(CHMODE_a, 0, 1, 0),
Expand Down
5 changes: 5 additions & 0 deletions ircd/m_join.c
Expand Up @@ -122,6 +122,11 @@ void do_join(struct Client *cptr, struct Client *sptr, struct JoinBuf *join,
return;
}

if (feature_bool(FEAT_CHANNEL_CREATE_IRCOPONLY) && !IsAnOper(sptr) && !IsChannelService(sptr)) {
send_reply(sptr, ERR_NOSUCHCHANNEL, chan);
return;
}

if (!(chptr = get_channel(sptr, chan, CGT_CREATE)))
return;

Expand Down

0 comments on commit 66e8f3a

Please sign in to comment.