From 098074ba8b18d53a4620464795e81aa052c285f9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 13 Jan 2025 14:36:55 +0000 Subject: [PATCH] Add an option to re-cloak opers on logout. Closes: #421 --- data/hostserv.example.conf | 5 +++++ modules/hostserv/hostserv.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/data/hostserv.example.conf b/data/hostserv.example.conf index e1275cc7a..1869c5eb9 100644 --- a/data/hostserv.example.conf +++ b/data/hostserv.example.conf @@ -80,6 +80,11 @@ module * If enabled, vhosts are activated on users immediately when they are set. */ activate_on_set = false + + /* + * If enabled, vhosts are activated on users immediately when they log out of an operator account. + */ + activate_on_deoper = yes } /* diff --git a/modules/hostserv/hostserv.cpp b/modules/hostserv/hostserv.cpp index 39b49ec29..82273f4e5 100644 --- a/modules/hostserv/hostserv.cpp +++ b/modules/hostserv/hostserv.cpp @@ -79,6 +79,12 @@ public: this->OnUserLogin(u); } + void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) override + { + if (mname == "OPER" && Config->GetModule(this)->Get("activate_on_deoper", "yes")) + this->OnUserLogin(u); + } + EventReturn OnPreHelp(CommandSource &source, const std::vector ¶ms) override { if (!params.empty() || source.c || source.service != *HostServ)