From 81ac8ff1b8b8fa7091a2c25359152b93d9d1a49d Mon Sep 17 00:00:00 2001
From: Sadie Powell
Date: Mon, 22 Jul 2024 21:49:58 +0100
Subject: Remove support for the v3 server protocol.
---
modules/spanningtree/server.cpp | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
(limited to 'modules/spanningtree/server.cpp')
diff --git a/modules/spanningtree/server.cpp b/modules/spanningtree/server.cpp
index 2da9e2a00..e6ceeacbb 100644
--- a/modules/spanningtree/server.cpp
+++ b/modules/spanningtree/server.cpp
@@ -98,8 +98,7 @@ void CommandServer::HandleExtra(TreeServer* newserver, Params& params)
std::shared_ptr TreeSocket::AuthRemote(const CommandBase::Params& params)
{
- size_t offset = proto_version == PROTO_INSPIRCD_3;
- if (params.size() < 4+offset)
+ if (params.size() < 4)
{
SendError("Protocol error - Not enough parameters for SERVER command");
return nullptr;
@@ -107,7 +106,7 @@ std::shared_ptr TreeSocket::AuthRemote(const CommandBase::Params& params)
const std::string& sname = params[0];
const std::string& password = params[1];
- const std::string& sid = params[2+offset];
+ const std::string& sid = params[2];
const std::string& description = params.back();
this->SendCapabilities(2);
@@ -171,7 +170,7 @@ bool TreeSocket::Outbound_Reply_Server(CommandBase::Params& params)
* While we're at it, create a treeserver object so we know about them.
* -- w
*/
- FinishAuth(params[0], params[proto_version == PROTO_INSPIRCD_3 ? 3 : 2], params.back(), x->Hidden);
+ FinishAuth(params[0], params[2], params.back(), x->Hidden);
return true;
}
@@ -217,16 +216,15 @@ bool TreeSocket::Inbound_Server(CommandBase::Params& params)
{
// Save these for later, so when they accept our credentials (indicated by BURST) we remember them
this->capab->hidden = x->Hidden;
- this->capab->sid = params[proto_version == PROTO_INSPIRCD_3 ? 3 : 2];
+ this->capab->sid = params[2];
this->capab->description = params.back();
this->capab->name = params[0];
// Send our details: Our server name and description and hopcount of 0,
// along with the sendpass from this block.
- this->WriteLine(fmt::format("SERVER {} {} {}{} :{}",
+ this->WriteLine(fmt::format("SERVER {} {} {} :{}",
ServerInstance->Config->ServerName,
TreeSocket::MakePass(x->SendPass, this->GetTheirChallenge()),
- proto_version == PROTO_INSPIRCD_3 ? "0 " : "",
ServerInstance->Config->ServerId,
ServerInstance->Config->ServerDesc
));
--
cgit v1.3.1-10-gc9f91