diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-22 13:47:55 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-22 13:47:55 +0000 |
commit | 8db7db4376d125e45f4bfc09e2f6c951932dc19a (patch) | |
tree | 430e205943451ae6f96682a5fcedcac95a6a133b /include | |
parent | fd97ca43bbe87959e58f3f47bcb338b7b3a4f3f5 (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 'include')
-rw-r--r-- | include/u_listmode.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/u_listmode.h b/include/u_listmode.h index f2abf70ca..2d973f40d 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -301,13 +301,21 @@ class ListModeBase : public ModeHandler { modelist* list; chan->GetExt(infokey, list); + irc::modestacker modestack(true); + std::deque<std::string> stackresult; if (list) { for (modelist::iterator it = list->begin(); it != list->end(); it++) { - proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, "+" + std::string(1, mode) + " " + it->mask); + modestack.Push(std::string(1, mode)[0], it->mask); } } + 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); + } } virtual void DoCleanup(int target_type, void* item) |