summaryrefslogtreecommitdiff
path: root/src/modules/m_chanprotect.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-22 13:47:55 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-22 13:47:55 +0000
commit8db7db4376d125e45f4bfc09e2f6c951932dc19a (patch)
tree430e205943451ae6f96682a5fcedcac95a6a133b /src/modules/m_chanprotect.cpp
parentfd97ca43bbe87959e58f3f47bcb338b7b3a4f3f5 (diff)
Make +beIgqa be sent multiple per line, rather than one per line, using modestacker and stringjoiner.
This cuts down server to server traffic a *lot*. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5515 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_chanprotect.cpp')
-rw-r--r--src/modules/m_chanprotect.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index 880e7c20d..89be44788 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -466,18 +466,25 @@ class ModuleChanProtect : public Module
string_list commands;
std::string founder = "cm_founder_"+std::string(chan->name);
std::string protect = "cm_protect_"+std::string(chan->name);
+ irc::modestacker modestack(true);
+ std::deque<std::string> stackresult;
for (CUList::iterator i = cl->begin(); i != cl->end(); i++)
{
if (i->second->GetExt(founder,dummyptr))
{
- proto->ProtoSendMode(opaque,TYPE_CHANNEL,chan,"+q "+std::string(i->second->nick));
+ modestack.Push('q',i->second->nick);
}
if (i->second->GetExt(protect,dummyptr))
{
- proto->ProtoSendMode(opaque,TYPE_CHANNEL,chan,"+a "+std::string(i->second->nick));
-
+ modestack.Push('a',i->second->nick);
}
}
+ while (modestack.GetStackedLine(stackresult))
+ {
+ irc::stringjoiner mode_join(" ", stackresult, 0, stackresult.size() - 1);
+ std::string line = mode_join.GetJoined();
+ proto->ProtoSendMode(opaque,TYPE_CHANNEL,chan, line);
+ }
}
}