From 2d189c572e3825ac9d16a5baffa08c8162cbc8a3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Feb 2024 14:44:27 +0000 Subject: Replace FRHOST with a two parameter version of FHOST. No compat layer needed here as FRHOST was added in v4. --- src/modules/m_spanningtree/compat.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/modules/m_spanningtree/compat.cpp') diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index 35aa8e6b6..6297bbd2c 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -66,20 +66,15 @@ void TreeSocket::WriteLine(const std::string& original_line) std::string command(line, cmdstart, cmdend - cmdstart); if (proto_version == PROTO_INSPIRCD_3) { - if (irc::equals(command, "FRHOST")) + if (irc::equals(command, "FHOST") || irc::equals(command, "FIDENT")) { - // FRHOST was introduced in PROTO_INSPIRCD_4; drop it. - return; - } - else if (irc::equals(command, "FIDENT")) - { - // FIDENT has two parameters in v4; drop the real username. - // : FIDENT + // FIDENT/FHOST has two parameters in v4; drop the real username/hostname. + // : FIDENT|FHOST size_t displayend = NextToken(line, cmdend); if (displayend != std::string::npos) { if ((displayend - cmdend) == 2 && line[displayend - 1] == '*') - return; // FIDENT is only changing the real username; drop. + return; // FIDENT/FHOST is only changing the real username/hostname; drop. // Trim the rest of the line. line.erase(displayend); @@ -126,7 +121,7 @@ void TreeSocket::WriteLine(const std::string& original_line) bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, CommandBase::Params& params) { - if (irc::equals(cmd, "FIDENT")) + if (irc::equals(cmd, "FHOST") || irc::equals(cmd, "FIDENT")) { if (params.size() < 2) params.push_back("*"); -- cgit v1.3.1-10-gc9f91