+ line = ":" + ServerInstance->Config->GetSID() + " SVSNICK" + uid + line.substr(b);
+ }
+ else if (proto_version < 1202 && command == "AWAY")
+ {
+ if (b != std::string::npos)
+ {
+ ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Stripping AWAY timestamp for 1201-protocol server");
+ std::string::size_type c = line.find(' ', b + 1);
+ line.erase(b,c-b);
+ }
+ }
+ else if (proto_version < 1202 && command == "ENCAP")
+ {
+ // :src ENCAP target command [args...]
+ // A B C D
+ // Therefore B and C cannot be npos in a valid command
+ if (b == std::string::npos)
+ return;
+ std::string::size_type c = line.find(' ', b + 1);
+ if (c == std::string::npos)
+ return;
+ std::string::size_type d = line.find(' ', c + 1);
+ std::string subcmd = line.substr(c, d - c);
+ Command* thiscmd = ServerInstance->Parser->GetHandler(subcmd);
+ if (thiscmd)
+ {
+ Version ver = thiscmd->creator->GetVersion();
+ if (ver.Flags & VF_OPTCOMMON)
+ {
+ ServerInstance->Logs->Log("m_spanningtree",DEBUG,"Removing ENCAP on '%s' for 1201-protocol server",
+ subcmd.c_str());
+ line.erase(a, c-a);
+ }
+ }