summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-11-23 10:53:30 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-11-23 10:53:30 +0100
commit91fe9afed5ee65f1d6dc1d0d3cdee628125f4d0d (patch)
treea01e07aef9466abe5fe36bbf526ff3eb03d611b7 /src
parenta652cdd9d9cb39ee1847bb393d7baa6c32340520 (diff)
m_operprefix Unset mode on unload
Fixes issue #1109 reported by @Sheogorath-SI
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_operprefix.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index 9f1f6cc5e..7d5e6d118 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -58,6 +58,39 @@ class OperPrefixMode : public ModeHandler
}
bool NeedsOper() { return true; }
+
+ void RemoveMode(Channel* chan, irc::modestacker* stack)
+ {
+ irc::modestacker modestack(false);
+ const UserMembList* users = chan->GetUsers();
+ for (UserMembCIter i = users->begin(); i != users->end(); ++i)
+ {
+ if (i->second->hasMode(mode))
+ {
+ if (stack)
+ stack->Push(this->GetModeChar(), i->first->nick);
+ else
+ modestack.Push(this->GetModeChar(), i->first->nick);
+ }
+ }
+
+ if (stack)
+ return;
+
+ std::deque<std::string> stackresult;
+ std::vector<std::string> mode_junk;
+ mode_junk.push_back(chan->name);
+ while (modestack.GetStackedLine(stackresult))
+ {
+ mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
+ ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
+ mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
+ }
+ }
+
+ void RemoveMode(User* user, irc::modestacker* stack)
+ {
+ }
};
class ModuleOperPrefixMode;