]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services_account.cpp
m_ssl_openssl Implement custom BIO methods that call SocketEngine methods
[user/henk/code/inspircd.git] / src / modules / m_services_account.cpp
index 1af06846ede773cc8555bc4e3b3b5ab0c818ee87..a11b05ca32852bcb0ae0c3bc6b7059310882b020 100644 (file)
@@ -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");
                }
        }