diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-07 01:29:45 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-07 01:29:45 +0000 |
commit | 96a4a1d41e42dba806c2e9954e148ed838262511 (patch) | |
tree | 3d1b2679437012f10133182d0aa8a8d9b7479350 /src/modules/m_spanningtree/protocolinterface.cpp | |
parent | 526f5a4a02882b19056fe755dff1f64b764ff313 (diff) |
Include explicit parameter list in ProtocolInterface::SendMode
Also leave the strings split into deque, there's no need to pack it into a
string just to unpack it during the translate.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11181 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 9f32963a0..cfc9bbea7 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -68,28 +68,25 @@ void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &top Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FTOPIC", params); } -void SpanningTreeProtocolInterface::SendMode(const std::string &target, parameterlist &modedata) +void SpanningTreeProtocolInterface::SendMode(const std::string &target, const parameterlist &modedata, const std::deque<TranslateType> &translate) { if (modedata.empty()) return; std::string outdata; - - /* Warning: in-place translation is only safe for type TR_NICK */ - for (size_t n = 0; n < modedata.size(); n++) - { - ServerInstance->Parser->TranslateUIDs(TR_NICK, modedata[n], outdata); - modedata[n] = outdata; - } + ServerInstance->Parser->TranslateUIDs(translate, modedata, outdata); std::string uidtarget; ServerInstance->Parser->TranslateUIDs(TR_NICK, target, uidtarget); - modedata.insert(modedata.begin(), uidtarget); + + parameterlist outlist; + outlist.push_back(uidtarget); + outlist.push_back(outdata); User* a = ServerInstance->FindNick(uidtarget); if (a) { - Utils->DoOneToMany(ServerInstance->Config->GetSID(),"MODE",modedata); + Utils->DoOneToMany(ServerInstance->Config->GetSID(),"MODE",outlist); return; } else @@ -97,8 +94,8 @@ void SpanningTreeProtocolInterface::SendMode(const std::string &target, paramete Channel* c = ServerInstance->FindChan(target); if (c) { - modedata.insert(modedata.begin() + 1, ConvToStr(c->age)); - Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FMODE",modedata); + outlist.insert(outlist.begin() + 1, ConvToStr(c->age)); + Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FMODE",outlist); } } } |