diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-02-11 16:46:11 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-02-11 16:46:11 +0100 |
commit | 8c2135aad0b2bbd8afca21a6c0664a9e4182dc9b (patch) | |
tree | bea044c796035dfbbb7af00a2bc90cab173b760e /include | |
parent | 7492344e64491cea6bbb5c9354dceb804bb908ac (diff) |
Convert the account login event to use the new cross-module event system
Diffstat (limited to 'include')
-rw-r--r-- | include/modules/account.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/include/modules/account.h b/include/modules/account.h index c00b044e4..0368127a6 100644 --- a/include/modules/account.h +++ b/include/modules/account.h @@ -22,16 +22,7 @@ #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 +30,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; +}; |