]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_banredirect Fix modestack usage
authorattilamolnar <attilamolnar@hush.com>
Wed, 12 Jun 2013 17:24:30 +0000 (19:24 +0200)
committerattilamolnar <attilamolnar@hush.com>
Wed, 12 Jun 2013 17:24:30 +0000 (19:24 +0200)
src/modules/m_banredirect.cpp

index c79023ccf5f0bd85222684906ee2e974e5d49d01..08b2244d4c6ec5e2b03be4fa5e9da6d929b8e118 100644 (file)
@@ -244,9 +244,6 @@ class ModuleBanRedirect : public Module
                        if(redirects)
                        {
                                irc::modestacker modestack(false);
-                               std::vector<std::string> stackresult;
-                               std::vector<std::string> mode_junk;
-                               mode_junk.push_back(chan->name);
 
                                for(BanRedirectList::iterator i = redirects->begin(); i != redirects->end(); i++)
                                {
@@ -259,11 +256,12 @@ class ModuleBanRedirect : public Module
                                        modestack.Push('b', i->banmask);
                                }
 
-                               while(modestack.GetStackedLine(stackresult))
+                               std::vector<std::string> stackresult;
+                               stackresult.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());
+                                       ServerInstance->Modes->Process(stackresult, ServerInstance->FakeClient);
+                                       stackresult.erase(stackresult.begin() + 1, stackresult.end());
                                }
                        }
                }