]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules/account.h
Add support for sending a standard reply with no command name.
[user/henk/code/inspircd.git] / include / modules / account.h
index c00b044e45ecaf1d70b694466a9e7cd077a045e7..eb478b9485520c2e54855c86f81a5955a7e4b0d5 100644 (file)
@@ -1,7 +1,12 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2008 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2015 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2013 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
+ *   Copyright (C) 2008 Craig Edwards <brain@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
 #include <map>
 #include <string>
 
-class AccountEvent : public Event
-{
- public:
-       User* const user;
-       const std::string account;
-       AccountEvent(Module* me, User* u, const std::string& name)
-               : Event(me, "account_login"), user(u), account(name)
-       {
-       }
-};
+#include "event.h"
 
 typedef StringExtItem AccountExtItem;
 
@@ -39,3 +35,19 @@ inline AccountExtItem* GetAccountExtItem()
 {
        return static_cast<AccountExtItem*>(ServerInstance->Extensions.GetItem("accountname"));
 }
+
+class AccountEventListener : public Events::ModuleEventListener
+{
+ public:
+       AccountEventListener(Module* mod)
+               : ModuleEventListener(mod, "event/account")
+       {
+       }
+
+       /** Called when a user logs in or logs out
+        * @param user User logging in or out
+        * @param newaccount New account name of the user or empty string if the user
+        * logged out
+        */
+       virtual void OnAccountChange(User* user, const std::string& newaccount) = 0;
+};