X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_services_account.cpp;h=a11b05ca32852bcb0ae0c3bc6b7059310882b020;hb=72555992d16af9a1ca28ada1dc70591fb7653dfe;hp=26a53b4d7038eaabf881dcb124ca20d456e5840e;hpb=8f5efbc7aa33b792e02d01e3288f553e6e98ccaa;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 26a53b4d7..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 %s :is logged in as", dest->nick.c_str(), 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, "%s :is a registered nick", dest->nick.c_str()); + whois.SendLine(307, ":is a registered nick"); } }