diff options
| author | 2024-02-27 14:37:40 +0000 | |
|---|---|---|
| committer | 2024-02-27 14:45:07 +0000 | |
| commit | fd25fe3c4fd24faa6270c8805462cb2d50d8834a (patch) | |
| tree | 29a7fb0927a1529b60621d635db5057549e56f11 /src/modules/m_spanningtree/compat.cpp | |
| parent | Set a command access for the SVSHOLD command. (diff) | |
Send the real username as the second parameter to FIDENT.
Diffstat (limited to 'src/modules/m_spanningtree/compat.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/compat.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp index d193d5e5a..35aa8e6b6 100644 --- a/src/modules/m_spanningtree/compat.cpp +++ b/src/modules/m_spanningtree/compat.cpp @@ -71,6 +71,20 @@ void TreeSocket::WriteLine(const std::string& original_line) // 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. + // :<sid> FIDENT <display|*> <real|*> + 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. + + // Trim the rest of the line. + line.erase(displayend); + } + } else if (irc::equals(command, "METADATA")) { // :<sid> METADATA <uuid|chan|*|@> <name> :<value> @@ -112,7 +126,12 @@ void TreeSocket::WriteLine(const std::string& original_line) bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, CommandBase::Params& params) { - if (irc::equals(cmd, "SVSJOIN") || irc::equals(cmd, "SVSNICK") || irc::equals(cmd, "SVSPART")) + if (irc::equals(cmd, "FIDENT")) + { + if (params.size() < 2) + params.push_back("*"); + } + else if (irc::equals(cmd, "SVSJOIN") || irc::equals(cmd, "SVSNICK") || irc::equals(cmd, "SVSPART")) { if (params.empty()) return false; // Malformed. |
