summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-08-22 01:48:17 -0400
committerAdam <Adam@anope.org>2013-08-22 01:48:17 -0400
commite8763d5b3ccf019f3da797f976af1fb90d300437 (patch)
treedae3d5cb0c9a99f4d0b63c62e3c4f65256ee88c3 /src/channels.cpp
parentce7a32a994136fa4ffd8489f8e56dde7b678ee07 (diff)
Always set +o on users who have access for it, even if higher modes have a prefix
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 84e90792d..4e8520bde 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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)
{