From 25d00181cd5a6b89c926e188e5f7569335ca64d0 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Sun, 21 Apr 2013 18:09:41 +0200 Subject: m_rline Switch to OnUserRegister hook to disconnect banned users earlier --- src/modules/m_rline.cpp | 12 ++++++++++-- 1 file 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) -- cgit v1.2.3