diff options
Diffstat (limited to 'include/modules')
| -rw-r--r-- | include/modules/cloak.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/modules/cloak.h b/include/modules/cloak.h index 2d3f41fd6..7a2d7d525 100644 --- a/include/modules/cloak.h +++ b/include/modules/cloak.h @@ -117,10 +117,25 @@ private: /** The name of the engine that created this method. */ std::string provname; + /** The connect classes that a user can be in before */ + insp::flat_set<std::string> classes; + protected: - Method(const Engine* engine) ATTR_NOT_NULL(2) + Method(const Engine* engine, const std::shared_ptr<ConfigTag>& tag) ATTR_NOT_NULL(2) : provname(engine->name) { + irc::commasepstream klassstream(tag->getString("class")); + for (std::string klass; klassstream.GetToken(klass); ) + classes.insert(klass); + } + + bool MatchesUser(LocalUser* user) const + { + if (!classes.empty() && !stdalgo::isin(classes, user->GetClass()->GetName())) + return false; + + // All fields matched. + return true; } public: |
