aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-08-28 23:47:38 +0100
committerGravatar Sadie Powell2021-08-28 23:47:51 +0100
commit932866d5e2535c0ebd760a33189d5c0a33c6e77a (patch)
treeae6006ed79b6f44afeab482110081c8af60edf08 /src/modules
parentForward SQUERY to services instead of downgrading it to PRIVMSG. (diff)
Make the protocol version enum entries slightly less verbose.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/capab.cpp8
-rw-r--r--src/modules/m_spanningtree/compat.cpp4
-rw-r--r--src/modules/m_spanningtree/main.cpp6
-rw-r--r--src/modules/m_spanningtree/main.h8
-rw-r--r--src/modules/m_spanningtree/netburst.cpp2
-rw-r--r--src/modules/m_spanningtree/utils.cpp2
6 files changed, 15 insertions, 15 deletions
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp
index d2f834e62..d45f2375c 100644
--- a/src/modules/m_spanningtree/capab.cpp
+++ b/src/modules/m_spanningtree/capab.cpp
@@ -49,7 +49,7 @@ namespace
std::string modname;
size_t endpos = name.length() - strlen(DLL_EXTENSION);
- if (protocol <= PROTO_INSPIRCD_30)
+ if (protocol <= PROTO_INSPIRCD_3)
{
// Replace m_foo.dylib with m_foo.so
modname.append(name.substr(0, endpos)).append(".so");
@@ -112,7 +112,7 @@ namespace
std::ostringstream& localmissing, std::ostringstream& remotemissing)
{
// Retrieve the local module list and compare to the remote.
- CapabData::ModuleMap mymodules = BuildModuleList(property, PROTO_INSPIRCD_30);
+ CapabData::ModuleMap mymodules = BuildModuleList(property, PROTO_INSPIRCD_3);
TokenDiff modulediff;
stdalgo::map::difference(mymodules, remote, modulediff);
@@ -200,7 +200,7 @@ namespace
bool okay;
std::ostringstream diffconfig, localmissing, remotemissing;
- if (protocol <= PROTO_INSPIRCD_30)
+ if (protocol <= PROTO_INSPIRCD_3)
okay = CompareModulesOld(property, *remote, diffconfig, localmissing, remotemissing);
else
okay = CompareModulesNew(property, *remote, diffconfig, localmissing, remotemissing);
@@ -337,7 +337,7 @@ void TreeSocket::SendCapabilities(int phase)
{ "MAXUSER", ConvToStr(ServerInstance->Config->Limits.MaxUser) },
};
- if (proto_version <= PROTO_INSPIRCD_30)
+ if (proto_version <= PROTO_INSPIRCD_3)
{
// 1205 HACK: Allow services to know what extbans exist.
dynamic_reference_nocheck<ExtBan::Manager> extbanmgr(Utils->Creator, "extbanmanager");
diff --git a/src/modules/m_spanningtree/compat.cpp b/src/modules/m_spanningtree/compat.cpp
index 1efe86316..85b7ec007 100644
--- a/src/modules/m_spanningtree/compat.cpp
+++ b/src/modules/m_spanningtree/compat.cpp
@@ -45,11 +45,11 @@ void TreeSocket::WriteLine(const std::string& original_line)
cmdend = line.size();
std::string command(line, cmdstart + 1, cmdend - cmdstart - 1);
- if (proto_version == PROTO_INSPIRCD_30)
+ if (proto_version == PROTO_INSPIRCD_3)
{
if (irc::equals(command, "SQUERY"))
{
- // SQUERY was introduced in PROTO_INSPIRCD_40_A1; convert to PRIVMSG.
+ // SQUERY was introduced in PROTO_INSPIRCD_4; convert to PRIVMSG.
line.replace(cmdstart + 1, cmdend - cmdstart - 1, "PRIVMSG");
}
}
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 95b3a1d77..af0be49d3 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -692,11 +692,11 @@ namespace
if (loading)
{
- const std::string linkstring = Utils->BuildLinkString(PROTO_INSPIRCD_40_A1, mod);
+ const std::string linkstring = Utils->BuildLinkString(PROTO_INSPIRCD_4, mod);
if (!linkstring.empty())
buffer << '=' << linkstring;
- const std::string compatlinkstring = Utils->BuildLinkString(PROTO_INSPIRCD_30, mod);
+ const std::string compatlinkstring = Utils->BuildLinkString(PROTO_INSPIRCD_3, mod);
if (!linkstring.empty())
compatbuffer << '=' << compatlinkstring;
}
@@ -706,7 +706,7 @@ namespace
if (!child->GetSocket())
continue; // Should never happen?
- if (child->GetSocket()->proto_version <= PROTO_INSPIRCD_30)
+ if (child->GetSocket()->proto_version <= PROTO_INSPIRCD_3)
CommandMetadata::Builder("modules", buffer.str()).Forward(child);
else
CommandMetadata::Builder("modules", compatbuffer.str()).Forward(child);
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 4e3227307..aff51ea36 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -48,16 +48,16 @@
enum ProtocolVersion : uint16_t
{
/** The linking protocol version introduced in InspIRCd v3.0. */
- PROTO_INSPIRCD_30 = 1205,
+ PROTO_INSPIRCD_3 = 1205,
/** The linking protocol version introduced in InspIRCd v4.0a1. */
- PROTO_INSPIRCD_40_A1 = 1206,
+ PROTO_INSPIRCD_4 = 1206,
/** The oldest version of the protocol that we support. */
- PROTO_OLDEST = PROTO_INSPIRCD_30,
+ PROTO_OLDEST = PROTO_INSPIRCD_3,
/** The newest version of the protocol that we support. */
- PROTO_NEWEST = PROTO_INSPIRCD_40_A1
+ PROTO_NEWEST = PROTO_INSPIRCD_4
};
/** Forward declarations
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index 07802e51b..6d1738041 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -189,7 +189,7 @@ void TreeSocket::SendXLines()
void TreeSocket::SendListModes(Channel* chan)
{
- if (proto_version < PROTO_INSPIRCD_40_A1)
+ if (proto_version < PROTO_INSPIRCD_4)
{
SendLegacyListModes(chan);
return;
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 322488847..1a0223858 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -369,7 +369,7 @@ std::string SpanningTreeUtilities::BuildLinkString(uint16_t proto, Module* mod)
std::string compatdata;
mod->GetLinkData(data, compatdata);
- if (proto <= PROTO_INSPIRCD_30)
+ if (proto <= PROTO_INSPIRCD_3)
return compatdata;
std::stringstream buffer;