mirror of
https://github.com/anope/anope.git
synced 2026-06-26 08:56:39 +02:00
Always set +o on users who have access for it, even if higher modes have a prefix
This commit is contained in:
+10
-6
@@ -795,21 +795,25 @@ void Channel::SetCorrectModes(User *user, bool give_modes)
|
||||
FOREACH_MOD(OnSetCorrectModes, (user, this, u_access, give_modes, take_modes));
|
||||
|
||||
/* Never take modes from ulines */
|
||||
take_modes &= !user->server->IsULined();
|
||||
if (user->server->IsULined())
|
||||
take_modes = false;
|
||||
|
||||
bool given = false;
|
||||
/* whether or not we are giving modes */
|
||||
bool giving = give_modes;
|
||||
for (unsigned i = 0; i < ModeManager::GetStatusChannelModesByRank().size(); ++i)
|
||||
{
|
||||
ChannelModeStatus *cm = ModeManager::GetStatusChannelModesByRank()[i];
|
||||
bool has_priv = u_access.HasPriv("AUTO" + cm->name);
|
||||
|
||||
/* If we have already given one mode, don't give more until it has a symbol */
|
||||
if (give_modes && has_priv && (!given || cm->symbol))
|
||||
if (give_modes && has_priv)
|
||||
{
|
||||
/* Always give op. If we have already given one mode, don't give more until it has a symbol */
|
||||
if (cm->name != "OP" && (!giving || !cm->symbol))
|
||||
continue;
|
||||
|
||||
this->SetMode(NULL, cm, user->GetUID());
|
||||
/* Now if this contains a symbol don't give any more modes, to prevent setting +qaohv etc on users */
|
||||
give_modes = !cm->symbol;
|
||||
given = true;
|
||||
giving = !cm->symbol;
|
||||
}
|
||||
else if (take_modes && !has_priv)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user