diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-05 11:31:18 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-05 11:31:18 +0000 |
commit | 0a162813268d16304eb5e3245abdc105433d56bd (patch) | |
tree | 3144eacd0c4390c3fb4daf73c84a409a5af6f490 | |
parent | a87b8e1e76ec7d451c98a055ced21c67867533c2 (diff) |
Redo the MODE warning stuff. Don't do some extra unneeded checks, don't allow SVSMODE on a channel, close any link that tries to do a MODE on a channel. FMODE with proper TS rules *must* be used.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9348 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 0483fa8e2..056df2cc5 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -30,8 +30,6 @@ /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */ -static std::map<std::string, std::string> warned; /* Server names that have had protocol violation warnings displayed for them */ - void TreeSocket::WriteLine(std::string line) { Instance->Logs->Log("m_spanningtree",DEBUG, "S[%d] O %s", this->GetFd(), line.c_str()); @@ -296,6 +294,9 @@ bool TreeSocket::ProcessLine(std::string &line) * First up, check for any malformed commands (e.g. MODE without a timestamp) * and rewrite commands where necessary (SVSMODE -> MODE for services). -- w */ + if (command == "SVSMODE") // This isn't in an "else if" so we still force FMODE for changes on channels. + command = "MODE"; + if (command == "MODE") { if (params.size() >= 2) @@ -303,23 +304,11 @@ bool TreeSocket::ProcessLine(std::string &line) Channel* channel = Instance->FindChan(params[0]); if (channel) { - User* x = Instance->FindNick(prefix); - if (x) - { - if (warned.find(x->server) == warned.end()) - { - Instance->Logs->Log("m_spanningtree",DEFAULT,"WARNING: I revceived modes '%s' from another server '%s'. This is not compliant with InspIRCd. Please check that server for bugs.", params[1].c_str(), x->server); - Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending nonstandard modes: '%s MODE %s' where FMODE should be used, and may cause desyncs.", x->server, x->nick, params[1].c_str()); - warned[x->server] = x->nick; - } - } + this->SendError("MODE may no longer be used on channels. Please use FMODE, with correct timestamp rules."); + return false; } } } - else if (command == "SVSMODE") - { - command = "MODE"; - } /* |