From 9fcb022d5e819eaff5cbb71e204ceeff4ca090f0 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 26 Sep 2024 11:22:10 +0100 Subject: Allow sending an oper account on InspIRCd. --- data/anope.example.conf | 2 -- modules/protocol/inspircd.cpp | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/data/anope.example.conf b/data/anope.example.conf index b6ea60d83..2123d1274 100644 --- a/data/anope.example.conf +++ b/data/anope.example.conf @@ -817,8 +817,6 @@ opertype * * This can be used to automatically oper users who identify for services operator accounts, and is * useful for setting modes such as Plexus's user mode +N. - * - * Note that some IRCds, such as InspIRCd, do not allow directly setting +o, and this will not work. */ #modes = "+o" } diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 258d030cb..563f65bcf 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -637,6 +637,17 @@ public: } } + void SendOper(User *u) override + { + if (spanningtree_proto_ver < 1206) + return; // We can't force an oper on this version. + + const Anope::map tags = { + { "~automatic", "" }, + }; + Uplink::Send(tags, "SVSOPER", u->GetUID(), u->Account()->o->ot->GetName()); + } + bool IsExtbanValid(const Anope::string &mask) override { bool inverted; -- cgit