summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-05 01:05:32 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-05 01:05:32 +0000
commit589ef7e89e7439feeb5f0abdbed3deaef2acb298 (patch)
treeca3954b703505e89ec8b6e9bc8f112d89e38858a /src/modules/m_spanningtree
parent18d36bfaf8a80d09325d3885ea39fe59f8ef4f09 (diff)
Fix crash in MODE when sent for a user, with only one parameter (which is wrong, anyway) - Also fix bad output in protocol interface when sending MODE for a user from a server origin
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9346 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp12
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp2
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;