X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules%2Faccount.h;h=0368127a6421e43ed9e00853769be5761baff975;hb=d4a1ea70451abb333e71f9cff09b624db59531a0;hp=c00b044e45ecaf1d70b694466a9e7cd077a045e7;hpb=3a3ff949670c61a4a8856e1391222e156eb1cd17;p=user%2Fhenk%2Fcode%2Finspircd.git 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 #include -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(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; +};