diff options
author | Adam <Adam@anope.org> | 2013-08-22 17:33:16 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-08-22 17:33:16 -0400 |
commit | 5ac0c9a32732fde91844a9b8c64e676893ea7331 (patch) | |
tree | 4d64189f9a66e43b0a9c4caf5fffe3af3c305ba1 /src/channels.cpp | |
parent | e8763d5b3ccf019f3da797f976af1fb90d300437 (diff) |
Fix previous commit
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 4e8520bde..22f90e28f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -800,6 +800,8 @@ void Channel::SetCorrectModes(User *user, bool give_modes) /* whether or not we are giving modes */ bool giving = give_modes; + /* whether or not we have given a mode */ + bool given = false; for (unsigned i = 0; i < ModeManager::GetStatusChannelModesByRank().size(); ++i) { ChannelModeStatus *cm = ModeManager::GetStatusChannelModesByRank()[i]; @@ -808,12 +810,13 @@ void Channel::SetCorrectModes(User *user, bool give_modes) 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 */ - giving = !cm->symbol; + if (cm->name == "OP" || !given || (giving && cm->symbol)) + { + 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 */ + giving = !cm->symbol; + given = true; + } } else if (take_modes && !has_priv) { |