summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-14 19:45:43 +0000
committerSadie Powell <sadie@witchery.services>2025-03-14 19:45:43 +0000
commit5ff86ea2c5361401de5f0deed0250ad4ae7dc853 (patch)
tree0db7ac1ee9e2a8065e210e948c2f60c003ed9922 /modules
parent1bdc9c0a649bfd8963ff591340b0f03ecd6bbe93 (diff)
Implement support for the new way of setting vhosts on InspIRCd.
Diffstat (limited to 'modules')
-rw-r--r--modules/protocol/inspircd.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp
index 8f103fbdb..f59440e17 100644
--- a/modules/protocol/inspircd.cpp
+++ b/modules/protocol/inspircd.cpp
@@ -510,6 +510,17 @@ public:
void SendVHost(User *u, const Anope::string &vident, const Anope::string &vhost) override
{
+ if (Servers::Capab.count("CLOAK"))
+ {
+ Anope::string cloak;
+ if (!vident.empty())
+ cloak.append(vident).push_back('@');
+ cloak.append(vhost);
+
+ Uplink::Send("METADATA", u->GetUID(), "custom-cloak", cloak);
+ return;
+ }
+
if (!vident.empty())
this->SendChgIdentInternal(u->GetUID(), vident);
@@ -2034,7 +2045,24 @@ public:
Log() << "InspIRCd " << (plus ? "loaded" : "unloaded") << " the " << modname << " module; adjusted functionality.";
}
+ }
+
+ else if (params[1].equals_cs("cloakmethods"))
+ {
+ spacesepstream tokens(params[2]);
+ for (Anope::string token; tokens.GetToken(token); )
+ {
+ const auto idx = token.find('=');
+ if (token.compare(0, idx, "custom", 6) == 0)
+ {
+ Log() << "The remote server has the custom cloak method; this will be used for setting vhosts.";
+ Servers::Capab.insert("CLOAK");
+ return;
+ }
+ }
+ Log() << "The remote server does not have the custom cloak method; CHGIDENT and CHGHOST will be used until the module is loaded.";
+ Servers::Capab.erase("CLOAK");
}
}
}