From 3487101cc190ea5529e9d6cf893a94f308f89a67 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 19 Aug 2023 16:27:02 +0100 Subject: Move the inspircd.org/service tag to the services module. --- src/modules/m_services.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/modules/m_services.cpp') diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index fdf4cf260..754008aa0 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -19,6 +19,7 @@ #include "inspircd.h" #include "modules/account.h" +#include "modules/ctctags.h" #include "modules/stats.h" #include "timeutils.h" #include "xline.h" @@ -76,6 +77,23 @@ public: } }; +class ServiceTag final + : public CTCTags::TagProvider +{ +public: + ServiceTag(Module* mod) + : CTCTags::TagProvider(mod) + { + } + + void OnPopulateTags(ClientProtocol::Message& msg) override + { + const auto* user = msg.GetSourceUser(); + if (user && user->server->IsService()) + msg.AddTag("inspircd.org/service", this, ""); + } +}; + class ServProtect final : public SimpleUserMode { @@ -199,6 +217,7 @@ private: Account::API accountapi; RegisteredChannel registeredcmode; RegisteredUser registeredumode; + ServiceTag servicetag; ServProtect servprotectmode; SVSHoldFactory svsholdfactory; CommandSVSHold svsholdcmd; @@ -211,6 +230,7 @@ public: , accountapi(this) , registeredcmode(this) , registeredumode(this) + , servicetag(this) , servprotectmode(this) , svsholdcmd(this) { -- cgit v1.3.1-10-gc9f91