diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2016-06-05 14:16:36 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-07-21 20:58:59 +0100 |
commit | 02b2a4ebcbd2eb71f7abaad36da2dc489c7c2d7c (patch) | |
tree | 2a3625f29859be965c7972f6fa131db0f9c9790b /modules | |
parent | 7a438c17063b92a23f9ab133a88097861a6f4527 (diff) |
Add global channel operator support
Diffstat (limited to 'modules')
-rw-r--r-- | modules/core/m_kick.c | 7 | ||||
-rw-r--r-- | modules/m_invite.c | 3 | ||||
-rw-r--r-- | modules/m_topic.c | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/modules/core/m_kick.c b/modules/core/m_kick.c index 2c88f15..1b15c4d 100644 --- a/modules/core/m_kick.c +++ b/modules/core/m_kick.c @@ -97,7 +97,7 @@ m_kick(struct Client *client_p, struct Client *source_p, } } - if (!has_member_flags(ms_source, CHFL_CHANOP|CHFL_HALFOP)) + if (!has_member_flags(ms_source, CHFL_CHANOP|CHFL_HALFOP) && !HasUMode(source_p, UMODE_GCHANOP)) { /* was a user, not a server, and user isn't seen as a chanop here */ if (MyConnect(source_p)) @@ -145,9 +145,10 @@ m_kick(struct Client *client_p, struct Client *source_p, if ((ms_target = find_channel_link(target_p, chptr)) != NULL) { #ifdef HALFOPS - if (has_member_flags(ms_source, CHFL_HALFOP) && !has_member_flags(ms_source, CHFL_CHANOP)) + /* half ops cannot kick other halfops on private channels */ + if (has_member_flags(ms_source, CHFL_HALFOP) && !has_member_flags(ms_source, CHFL_CHANOP) && !HasUMode(source_p, UMODE_GCHANOP)) { - if (has_member_flags(ms_target, CHFL_CHANOP|CHFL_HALFOP)) + if (has_member_flags(ms_target, CHFL_CHANOP|CHFL_HALFOP) || HasUMode(target_p, UMODE_GCHANOP)) { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chptr->chname); diff --git a/modules/m_invite.c b/modules/m_invite.c index 2eb3de6..48e86e6 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -90,7 +90,8 @@ m_invite(struct Client *client_p, struct Client *source_p, return 0; } - if (MyConnect(source_p) && !has_member_flags(ms, CHFL_CHANOP)) + if (MyConnect(source_p) && !has_member_flags(ms, CHFL_CHANOP) + && !HasUMode(source_p, UMODE_GCHANOP)) { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chptr->chname); diff --git a/modules/m_topic.c b/modules/m_topic.c index 4606e32..3aa5e3d 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -81,7 +81,8 @@ m_topic(struct Client *client_p, struct Client *source_p, } if (!(chptr->mode.mode & MODE_TOPICLIMIT) || - has_member_flags(ms, CHFL_CHANOP|CHFL_HALFOP)) + has_member_flags(ms, CHFL_CHANOP|CHFL_HALFOP) || + HasUMode(source_p, UMODE_GCHANOP)) { char topic_info[USERHOST_REPLYLEN]; |