From 5a30926e2b3b54e1ee3562dea6119d9237814e9f Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 24 Aug 2018 12:24:07 +0100 Subject: Allow unlocking jumpserver and lockserv with a module rehash. Closes #282. --- src/modules/m_jumpserver.cpp | 6 ++++++ src/modules/m_lockserv.cpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index 9f3b41af7..682e353d2 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -161,6 +161,12 @@ class ModuleJumpServer : public Module { } + void OnModuleRehash(User* user, const std::string& param) CXX11_OVERRIDE + { + if (irc::equals(param, "jumpserver") && js.redirect_new_users) + js.redirect_new_users = false; + } + ModResult OnUserRegister(LocalUser* user) CXX11_OVERRIDE { if (js.redirect_new_users) diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp index 45a0095d7..2db01b99a 100644 --- a/src/modules/m_lockserv.cpp +++ b/src/modules/m_lockserv.cpp @@ -100,6 +100,12 @@ class ModuleLockserv : public Module locked.clear(); } + void OnModuleRehash(User* user, const std::string& param) CXX11_OVERRIDE + { + if (irc::equals(param, "lockserv") && !locked.empty()) + locked.clear(); + } + ModResult OnUserRegister(LocalUser* user) CXX11_OVERRIDE { if (!locked.empty()) -- cgit v1.2.3