From ea9a72c5a586517abc99412221bb1752f0b20b51 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 3 Jul 2021 18:58:13 +0100 Subject: Allow hostchange to select users based on connect class. --- src/modules/m_hostchange.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/modules/m_hostchange.cpp') diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 4a4317625..b0b3275e9 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -45,6 +45,7 @@ class HostRule private: HostChangeAction action; std::string host; + std::string klass; std::string mask; insp::flat_set ports; std::string prefix; @@ -52,6 +53,9 @@ class HostRule void ReadConfig(ConfigTag* tag) { + // Parse . + klass = tag->getString("class"); + // Parse . const std::string portlist = tag->getString("ports"); if (!portlist.empty()) @@ -92,6 +96,9 @@ class HostRule bool Matches(LocalUser* user) const { + if (!klass.empty() && !stdalgo::string::equalsci(klass, user->MyClass->GetName())) + return false; + if (!ports.empty() && !ports.count(user->server_sa.port())) return false; -- cgit v1.3.1-10-gc9f91