diff options
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 12 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index f204c15ed..a31675ad6 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -49,14 +49,24 @@ void SpanningTreeProtocolInterface::SendMode(const std::string &target, paramete 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], modedata[n]); + { + ServerInstance->Parser->TranslateUIDs(TR_NICK, modedata[n], outdata); + modedata[n] = outdata; + } std::string uidtarget; ServerInstance->Parser->TranslateUIDs(TR_NICK, target, uidtarget); modedata.insert(modedata.begin(), uidtarget); + for (size_t n = 0; n < modedata.size(); n++) + { + ServerInstance->Logs->Log("m_spanningtree", DEBUG, "modedata[%d]=\"%s\"", n, modedata[n].c_str()); + } + User* a = ServerInstance->FindNick(uidtarget); if (a) { diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 4b4ba65f0..0483fa8e2 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -540,7 +540,7 @@ bool TreeSocket::ProcessLine(std::string &line) /* We don't support this for channel mode changes any more! */ if (params.size() >= 1) { - if (Instance->FindChan(params[1])) + if (Instance->FindChan(params[0])) { this->SendError("Protocol violation by '"+prefix+"'! MODE for channel mode changes is not supported by the InspIRCd 1.2 protocol. You must use FMODE to preserve channel timestamps."); return false; |