mirror of
https://github.com/anope/anope.git
synced 2026-06-29 23:56:39 +02:00
Don't unset modes which have no privilege associated with them
This commit is contained in:
@@ -1055,15 +1055,6 @@ class ProtoInspIRCd20 : public Module
|
||||
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override
|
||||
{
|
||||
if ((setter.GetUser() && setter.GetUser()->server == Me) || setter.GetServer() == Me || !setter.GetServer())
|
||||
if (mode->name == "OPERPREFIX")
|
||||
c->SetMode(c->ci->WhoSends(), mode, param, false);
|
||||
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(ProtoInspIRCd20)
|
||||
|
||||
+2
-1
@@ -858,7 +858,8 @@ void Channel::SetCorrectModes(User *user, bool give_modes)
|
||||
given = true;
|
||||
}
|
||||
}
|
||||
else if (take_modes && !has_priv && !u_access.HasPriv(cm->name + "ME"))
|
||||
/* modes that have no privileges assigned shouldn't be removed (like operprefix, ojoin) */
|
||||
else if (take_modes && !has_priv && ci->GetLevel(cm->name + "ME") != ACCESS_INVALID && !u_access.HasPriv(cm->name + "ME"))
|
||||
{
|
||||
/* Only remove modes if they are > voice */
|
||||
if (cm->name == "VOICE")
|
||||
|
||||
Reference in New Issue
Block a user