X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_services_account.cpp;h=a11b05ca32852bcb0ae0c3bc6b7059310882b020;hb=5544649cd2058ba6d30925e61d20ae4a0245c0fa;hp=1af06846ede773cc8555bc4e3b3b5ab0c818ee87;hpb=04eb0e182dec8518d1dfd15a09b8054d1501a4ef;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 1af06846e..a11b05ca3 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -133,7 +133,7 @@ class AccountExtItemImpl : public AccountExtItem } }; -class ModuleServicesAccount : public Module +class ModuleServicesAccount : public Module, public Whois::EventListener { AChannel_R m1; AChannel_M m2; @@ -143,8 +143,10 @@ class ModuleServicesAccount : public Module AccountExtItemImpl accountname; bool checking_ban; public: - ModuleServicesAccount() : m1(this), m2(this), m3(this), m4(this), m5(this), - accountname(this) + ModuleServicesAccount() + : Whois::EventListener(this) + , m1(this), m2(this), m3(this), m4(this), m5(this) + , accountname(this) , checking_ban(false) { } @@ -156,19 +158,19 @@ class ModuleServicesAccount : public Module } /* <- :twisted.oscnet.org 330 w00t2 w00t2 w00t :is logged in as */ - void OnWhois(User* source, User* dest) CXX11_OVERRIDE + void OnWhois(Whois::Context& whois) CXX11_OVERRIDE { - std::string *account = accountname.get(dest); + std::string* account = accountname.get(whois.GetTarget()); if (account) { - ServerInstance->SendWhoisLine(source, dest, 330, "%s :is logged in as", account->c_str()); + whois.SendLine(330, "%s :is logged in as", account->c_str()); } - if (dest->IsModeSet(m5)) + if (whois.GetTarget()->IsModeSet(m5)) { /* user is registered */ - ServerInstance->SendWhoisLine(source, dest, 307, ":is a registered nick"); + whois.SendLine(307, ":is a registered nick"); } }