From 986d587ea4bba1e89fc241220621d0834464ea28 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 14 May 2022 14:35:07 +0100 Subject: Add the new account system. This still relies on the old extensibles for now but we can change that later. --- src/modules/m_ircv3.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/m_ircv3.cpp') diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp index beefa24a4..ea3c157a6 100644 --- a/src/modules/m_ircv3.cpp +++ b/src/modules/m_ircv3.cpp @@ -51,6 +51,8 @@ public: class JoinHook final : public ClientProtocol::EventHook { +private: + Account::API accountapi; ClientProtocol::Events::Join extendedjoinmsg; public: @@ -62,6 +64,7 @@ public: JoinHook(Module* mod) : ClientProtocol::EventHook(mod, "JOIN") + , accountapi(mod) , asterisk(1, '*') , awayprotoev(mod, "AWAY") , extendedjoincap(mod, "extended-join") @@ -79,10 +82,9 @@ public: Membership* const memb = join.GetMember(); const std::string* account = &asterisk; - const AccountExtItem* const accountext = GetAccountExtItem(); - if (accountext) + if (accountapi) { - const std::string* accountname = accountext->Get(memb->user); + const std::string* accountname = accountapi->GetAccountName(memb->user); if (accountname) account = accountname; } @@ -115,7 +117,7 @@ public: class ModuleIRCv3 final : public Module - , public AccountEventListener + , public Account::EventListener , public Away::EventListener { private: @@ -126,7 +128,7 @@ private: public: ModuleIRCv3() : Module(VF_VENDOR, "Provides the IRCv3 account-notify, away-notify, and extended-join client capabilities.") - , AccountEventListener(this) + , Account::EventListener(this) , Away::EventListener(this) , cap_accountnotify(this, "account-notify") , joinhook(this) -- cgit v1.3.1-10-gc9f91