From 97e1ad2daa459dcba248e5b3062046428ae2d253 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 1 May 2022 14:25:02 +0100 Subject: Implement the 'r' (registered nick) WHO flag from UnrealIRCd. --- src/modules/m_services_account.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 87bd5cf13..fa567ce94 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -31,6 +31,7 @@ #include "modules/callerid.h" #include "modules/ctctags.h" #include "modules/exemption.h" +#include "modules/who.h" #include "modules/whois.h" enum @@ -137,6 +138,7 @@ class AccountExtItemImpl : public AccountExtItem class ModuleServicesAccount : public Module + , public Who::EventListener , public Whois::EventListener , public CTCTags::EventListener { @@ -154,7 +156,8 @@ class ModuleServicesAccount public: ModuleServicesAccount() - : Whois::EventListener(this) + : Who::EventListener(this) + , Whois::EventListener(this) , CTCTags::EventListener(this) , calleridapi(this) , exemptionprov(this) @@ -175,6 +178,18 @@ class ModuleServicesAccount tokens["EXTBAN"].push_back('U'); } + ModResult OnWhoLine(const Who::Request& request, LocalUser* source, User* user, Membership* memb, Numeric::Numeric& numeric) CXX11_OVERRIDE + { + size_t flag_index; + if (!request.GetFieldIndex('f', flag_index)) + return MOD_RES_PASSTHRU; + + if (user->IsModeSet(userregmode)) + numeric.GetParams()[flag_index].push_back('r'); + + return MOD_RES_PASSTHRU; + } + /* <- :twisted.oscnet.org 330 w00t2 w00t2 w00t :is logged in as */ void OnWhois(Whois::Context& whois) CXX11_OVERRIDE { -- cgit v1.3.1-10-gc9f91