diff options
author | louiz’ <louiz@louiz.org> | 2016-05-22 12:54:18 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-06-08 01:42:43 +0200 |
commit | 711861d40e365564e3828a251066c16e924d30f3 (patch) | |
tree | f9501b71283afbdab0c06b4e9b4cc6cc8ec8ae03 /src/bridge/bridge.hpp | |
parent | 367de4826c3c7298a88e80c92e325081a3c3d794 (diff) | |
download | biboumi-711861d40e365564e3828a251066c16e924d30f3.tar.gz biboumi-711861d40e365564e3828a251066c16e924d30f3.tar.bz2 biboumi-711861d40e365564e3828a251066c16e924d30f3.tar.xz biboumi-711861d40e365564e3828a251066c16e924d30f3.zip |
Add methods to know which resource is on which server or channel
Diffstat (limited to 'src/bridge/bridge.hpp')
-rw-r--r-- | src/bridge/bridge.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index 2676d1d..b852a30 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -194,6 +194,13 @@ public: void trigger_on_irc_message(const std::string& irc_hostname, const IrcMessage& message); std::unordered_map<std::string, std::shared_ptr<IrcClient>>& get_irc_clients(); + /** + * Manage which resource is in which channel + */ + void add_resource_to_chan(const std::string& channel, const std::string& resource); + void remove_resource_from_chan(const std::string& channel, const std::string& resource); + bool is_resource_in_chan(const std::string& channel, const std::string& resource) const; + private: /** * Returns the client for the given hostname, create one (and use the @@ -244,6 +251,10 @@ private: * response iq. */ std::list<irc_responder_callback_t> waiting_irc; + /** + * Keep track of which resource is in which channel. + */ + std::map<std::string, std::set<std::string>> resources_in_chan; }; struct IRCNotConnected: public std::exception |