#pragma once #include #include #include #include class Connection; class CommandEvent; class PrivThread : std::enable_shared_from_this { Connection& connection_; std::string config_path_; std::unordered_map> oper_privs; std::unordered_map> account_privs; auto on_command(CommandEvent&) -> void; auto check( std::unordered_map> const& privs, std::string const& priv, std::string const& name) -> bool; auto load_config() -> void; public: PrivThread(Connection&, std::string config_path); auto check_command(CommandEvent& event, std::string priv) -> bool; static constexpr char const* owner_priv = "owner"; static auto start(Connection&, std::string config_path) -> std::shared_ptr; };