summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-03-07 18:27:14 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-03-07 18:27:14 +0000
commit8cebf7069a5eba14a33ced91f1e7ec75e01162d3 (patch)
tree1620e0a02d2e1c224e0a473dad53c0ebd680a340 /src/channels.cpp
parentebaaf39a06ac532434b49926034ea1fea3001f8d (diff)
Make "topiclock" exemption only apply when +t is set
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12613 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 5603ef1dd..cdc988139 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -92,13 +92,14 @@ int Channel::SetTopic(User *u, std::string &ntopic, bool forceset)
return CMD_FAILURE;
if (res != MOD_RES_ALLOW)
{
- bool defok = IsModeSet('t') ? GetPrefixValue(u) >= HALFOP_VALUE : HasUser(u);
- if (!ServerInstance->OnCheckExemption(u,this,"topiclock").check(defok))
+ if (!this->HasUser(u))
{
- 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());
+ u->WriteNumeric(442, "%s %s :You're not on that channel!",u->nick.c_str(), this->name.c_str());
+ return CMD_FAILURE;
+ }
+ if (IsModeSet('t') && !ServerInstance->OnCheckExemption(u,this,"topiclock").check(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());
return CMD_FAILURE;
}
}