]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_operprefix Unset mode on unload
authorAttila Molnar <attilamolnar@hush.com>
Mon, 23 Nov 2015 09:53:30 +0000 (10:53 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Mon, 23 Nov 2015 09:53:30 +0000 (10:53 +0100)
Fixes issue #1109 reported by @Sheogorath-SI

src/modules/m_operprefix.cpp

index 9f1f6cc5e8f3f25863a940abde3513d133767d46..7d5e6d1181151f0cfae5c7b243205fed2d910248 100644 (file)
@@ -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;