diff options
-rw-r--r-- | modules/commands/cs_access.cpp | 2 | ||||
-rw-r--r-- | modules/extra/m_statusupdate.cpp | 5 | ||||
-rw-r--r-- | modules/pseudoclients/bs_main.cpp | 1 | ||||
-rw-r--r-- | src/access.cpp | 16 |
4 files changed, 20 insertions, 4 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 7c444b52c..a8e90aadd 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -326,7 +326,7 @@ class CommandCSAccess : public Command if (mask.equals_ci(access->mask)) { /* Don't allow lowering from a level >= u_level */ - if (AccessChanAccess::DetermineLevel(access) >= u_level && !u->HasPriv("chanserv/access/modify")) + if (AccessChanAccess::DetermineLevel(access) >= u_level && !u_access.Founder && !u->HasPriv("chanserv/access/modify")) { source.Reply(ACCESS_DENIED); return; diff --git a/modules/extra/m_statusupdate.cpp b/modules/extra/m_statusupdate.cpp index 2b23492ec..6f98c1345 100644 --- a/modules/extra/m_statusupdate.cpp +++ b/modules/extra/m_statusupdate.cpp @@ -41,10 +41,9 @@ class StatusUpdate : public Module if (access->Matches(user, user->Account())) { for (int i = 0; modeInfo[i].priv != CA_SIZE; ++i) - if (access->HasPriv(modeInfo[i].priv)) - ci->c->SetMode(NULL, modeInfo[i].name, user->nick); - else + if (!access->HasPriv(modeInfo[i].priv)) ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); + chan_set_correct_modes(user, ci->c, 1); } } } diff --git a/modules/pseudoclients/bs_main.cpp b/modules/pseudoclients/bs_main.cpp index 34214ad3d..488c30de6 100644 --- a/modules/pseudoclients/bs_main.cpp +++ b/modules/pseudoclients/bs_main.cpp @@ -104,6 +104,7 @@ class BotServCore : public Module if (!command->HasFlag(CFLAG_STRIP_CHANNEL)) params.insert(params.begin(), this->fantasy_channel->name); source.c = this->fantasy_channel; + source.service = this->fantasy_channel->ci->WhoSends(); } return EVENT_CONTINUE; diff --git a/src/access.cpp b/src/access.cpp index 61536ed81..3559a8209 100644 --- a/src/access.cpp +++ b/src/access.cpp @@ -115,6 +115,10 @@ ChanAccess *AccessGroup::Highest() const bool AccessGroup::operator>(const AccessGroup &other) const { + if (this->SuperAdmin) + return true; + else if (this->Founder && !other.Founder) + return true; for (size_t i = CA_SIZE; i > 0; --i) if (this->HasPriv(static_cast<ChannelAccess>(i - 1)) && !other.HasPriv(static_cast<ChannelAccess>(i - 1))) return true; @@ -123,6 +127,10 @@ bool AccessGroup::operator>(const AccessGroup &other) const bool AccessGroup::operator<(const AccessGroup &other) const { + if (other.SuperAdmin) + return false; + else if (other.Founder && !this->Founder) + return true; for (size_t i = CA_SIZE; i > 0; --i) if (!this->HasPriv(static_cast<ChannelAccess>(i - 1)) && other.HasPriv(static_cast<ChannelAccess>(i - 1))) return true; @@ -131,6 +139,10 @@ bool AccessGroup::operator<(const AccessGroup &other) const bool AccessGroup::operator>=(const AccessGroup &other) const { + if (this->SuperAdmin) + return true; + else if (this->Founder) + return true; for (size_t i = CA_SIZE; i > 0; --i) { bool this_p = this->HasPriv(static_cast<ChannelAccess>(i - 1)), @@ -145,6 +157,10 @@ bool AccessGroup::operator>=(const AccessGroup &other) const bool AccessGroup::operator<=(const AccessGroup &other) const { + if (other.SuperAdmin) + return true; + else if (other.Founder) + return true; for (size_t i = CA_SIZE; i > 0; --i) { bool this_p = this->HasPriv(static_cast<ChannelAccess>(i - 1)), |