X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fu_listmode.h;h=0a2c25710568235ea65fc90211f25c64ef0456fe;hb=94bb5343b1464cbec9f58ee9d90a3deae3ac5308;hp=b08ad8d4dc82ec131cc8f20c9fc8b3877168688e;hpb=f209cce90b394acd26e22eacef0bff61e8f5b4e1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/u_listmode.h b/include/u_listmode.h index b08ad8d4d..0a2c25710 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -200,9 +200,6 @@ class ListModeBase : public ModeHandler if (el) { irc::modestacker modestack(ServerInstance, false); - std::deque stackresult; - std::vector mode_junk; - mode_junk.push_back(channel->name); for (modelist::iterator it = el->begin(); it != el->end(); it++) { @@ -215,14 +212,13 @@ class ListModeBase : public ModeHandler if (stack) return; + std::vector stackresult; + stackresult.push_back(channel->name); while (modestack.GetStackedLine(stackresult)) { - for (size_t j = 0; j < stackresult.size(); j++) - { - mode_junk.push_back(stackresult[j]); - } - - ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient); + ServerInstance->SendMode(stackresult, ServerInstance->FakeClient); + stackresult.clear(); + stackresult.push_back(channel->name); } } } @@ -422,7 +418,9 @@ class ListModeBase : public ModeHandler modelist* mlist; chan->GetExt(infokey, mlist); irc::modestacker modestack(ServerInstance, true); - std::deque stackresult; + std::vector stackresult; + std::vector types; + types.push_back(TR_TEXT); if (mlist) { for (modelist::iterator it = mlist->begin(); it != mlist->end(); it++) @@ -432,9 +430,9 @@ class ListModeBase : public ModeHandler } 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); + types.assign(stackresult.size(), this->GetTranslateType()); + proto->ProtoSendMode(opaque, TYPE_CHANNEL, chan, stackresult, types); + stackresult.clear(); } }