diff options
Diffstat (limited to 'src/modules/m_autoop.cpp')
| -rw-r--r-- | src/modules/m_autoop.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp index 48a89f0d5..9d648a88c 100644 --- a/src/modules/m_autoop.cpp +++ b/src/modules/m_autoop.cpp @@ -12,6 +12,7 @@ */ #include "inspircd.h" +#include "account.h" #include "opflags.h" #include "u_listmode.h" @@ -88,8 +89,8 @@ public: ServerInstance->Modules->AddService(mh); ServerInstance->AddCommand(&cmd); - Implementation list[] = { I_OnPostJoin }; - ServerInstance->Modules->Attach(list, this, 1); + Implementation list[] = { I_OnPostJoin, I_OnEvent }; + ServerInstance->Modules->Attach(list, this, 2); } void DoAutoop(Membership* memb) @@ -140,6 +141,17 @@ public: DoAutoop(memb); } + void OnEvent(Event& event) + { + if(event.id == "account_login"){ + AccountEvent& acct_event = static_cast<AccountEvent&>(event); + if(!IS_LOCAL(acct_event.user)) return; + std::vector<std::string> params; + for (UCListIter v = acct_event.user->chans.begin(); v != acct_event.user->chans.end(); ++v) + DoAutoop(&*v); + } + } + void ReadConfig(ConfigReadStatus&) { mh.DoRehash(); |
