From 37b9455f70ad2fd919aa83a2c96a1e4764a3b25a Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 9 Feb 2010 15:18:06 +0000 Subject: Allow exemptchanops to modify the channel access level needed to bypass +t git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12413 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 14 +++++++------- src/modules/m_exemptchanops.cpp | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/channels.cpp b/src/channels.cpp index 0b9eb1cc4..ee1ba2e1f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -92,14 +92,14 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset) return CMD_FAILURE; if (res != MOD_RES_ALLOW) { - if (!this->HasUser(u)) + FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (u,this,"topiclock")); + bool defok = IsModeSet('t') ? GetPrefixValue(u) >= HALFOP_VALUE : HasUser(u); + if (!res.check(defok)) { - u->WriteNumeric(442, "%s %s :You're not on that channel!",u->nick.c_str(), this->name.c_str()); - return CMD_FAILURE; - } - if ((this->IsModeSet('t')) && (this->GetPrefixValue(u) < HALFOP_VALUE)) - { - u->WriteNumeric(482, "%s %s :You do not have access to change the topic on this channel", u->nick.c_str(), this->name.c_str()); + if (!this->HasUser(u)) + u->WriteNumeric(442, "%s %s :You're not on that channel!",u->nick.c_str(), this->name.c_str()); + else + u->WriteNumeric(482, "%s %s :You do not have access to change the topic on this channel", u->nick.c_str(), this->name.c_str()); return CMD_FAILURE; } } diff --git a/src/modules/m_exemptchanops.cpp b/src/modules/m_exemptchanops.cpp index f4a8c5d5a..df5ec4bf3 100644 --- a/src/modules/m_exemptchanops.cpp +++ b/src/modules/m_exemptchanops.cpp @@ -125,6 +125,8 @@ class ModuleExemptChanOps : public Module ModeHandler* mh = ServerInstance->Modes->FindMode(minmode, MODETYPE_CHANNEL); if (mh && mypfx >= mh->GetPrefixRank()) return MOD_RES_ALLOW; + if (mh || minmode == '*') + return MOD_RES_DENY; return MOD_RES_PASSTHRU; } }; -- cgit v1.2.3