mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 21:53:13 +02:00
Refactor permissions in m_topic
This commit is contained in:
@@ -166,7 +166,7 @@ long flags = 0; /* cache: membership flags */
|
||||
}
|
||||
|
||||
/* If you're not a member, and you can't view outside channel, deny */
|
||||
if ((!ismember && i == HOOK_DENY) || (is_banned(sptr,chptr,BANCHK_JOIN) && !IsAnOper(sptr)))
|
||||
if ((!ismember && i == HOOK_DENY) || (is_banned(sptr,chptr,BANCHK_JOIN) && !OperClass_evaluateACLPath("channel:view",sptr,NULL,chptr,NULL)))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOTONCHANNEL), me.name, parv[0], name);
|
||||
return 0;
|
||||
@@ -231,8 +231,8 @@ long flags = 0; /* cache: membership flags */
|
||||
}
|
||||
}
|
||||
else if (((chptr->mode.mode & MODE_TOPICLIMIT) == 0 ||
|
||||
(is_chan_op(sptr, chptr)) || IsOper(sptr)
|
||||
|| IsULine(sptr) || is_halfop(sptr, chptr)) && topic)
|
||||
(is_chan_op(sptr, chptr)) || OperClass_evaluateACLPath("channel:topic",sptr,NULL,chptr,NULL)
|
||||
|| is_halfop(sptr, chptr)) && topic)
|
||||
{
|
||||
/* setting a topic */
|
||||
if (chptr->mode.mode & MODE_TOPICLIMIT)
|
||||
@@ -241,7 +241,7 @@ long flags = 0; /* cache: membership flags */
|
||||
is_chan_op(sptr, chptr))
|
||||
{
|
||||
#ifndef NO_OPEROVERRIDE
|
||||
if ((MyClient(sptr) ? (!IsOper(sptr) || !OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL)) : !IsOper(sptr)))
|
||||
if (!OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
|
||||
{
|
||||
#endif
|
||||
sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED),
|
||||
@@ -258,7 +258,7 @@ long flags = 0; /* cache: membership flags */
|
||||
{
|
||||
char buf[512];
|
||||
|
||||
if (IsOper(sptr) && OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
|
||||
if (OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
|
||||
{
|
||||
topicoverride(sptr, chptr, topic);
|
||||
} else {
|
||||
@@ -271,7 +271,7 @@ long flags = 0; /* cache: membership flags */
|
||||
{
|
||||
char buf[512];
|
||||
|
||||
if (IsOper(sptr) && OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
|
||||
if (OperClass_evaluateACLPath("override:topic",sptr,NULL,chptr,NULL))
|
||||
{
|
||||
topicoverride(sptr, chptr, topic);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user