diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-04-21 18:09:41 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-04-21 18:09:41 +0200 |
commit | 25d00181cd5a6b89c926e188e5f7569335ca64d0 (patch) | |
tree | 4f4b525b89db2c9cd6ac6e30f3642c7b9ba3b787 /src | |
parent | 216877cc5b595b5b6bbc5f953e226618201cc0f6 (diff) |
m_rline Switch to OnUserRegister hook to disconnect banned users earlier
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_rline.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index bbe8ede9a..160092a63 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -241,7 +241,7 @@ class ModuleRLine : public Module ServerInstance->Modules->AddService(r); ServerInstance->XLines->RegisterFactory(&f); - Implementation eventlist[] = { I_OnUserConnect, I_OnRehash, I_OnUserPostNick, I_OnStats, I_OnBackgroundTimer, I_OnUnloadModule }; + Implementation eventlist[] = { I_OnUserRegister, I_OnRehash, I_OnUserPostNick, I_OnStats, I_OnBackgroundTimer, I_OnUnloadModule }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } @@ -256,7 +256,7 @@ class ModuleRLine : public Module return Version("RLINE: Regexp user banning.", VF_COMMON | VF_VENDOR, rxfactory ? rxfactory->name : ""); } - virtual void OnUserConnect(LocalUser* user) + ModResult OnUserRegister(LocalUser* user) { // Apply lines on user connect XLine *rl = ServerInstance->XLines->MatchesLine("R", user); @@ -265,7 +265,9 @@ class ModuleRLine : public Module { // Bang. :P rl->Apply(user); + return MOD_RES_DENY; } + return MOD_RES_PASSTHRU; } virtual void OnRehash(User *user) @@ -349,6 +351,12 @@ class ModuleRLine : public Module ServerInstance->XLines->DelAll(f.GetType()); } } + + void Prioritize() + { + Module* mod = ServerInstance->Modules->Find("m_cgiirc.so"); + ServerInstance->Modules->SetPriority(this, I_OnUserRegister, PRIORITY_AFTER, mod); + } }; MODULE_INIT(ModuleRLine) |