diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-05-31 17:06:36 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-05-31 17:06:36 +0200 |
commit | 4e27298b3a6389781893589b37f66260d6a34707 (patch) | |
tree | 5b33fe906f698c4b2789197d51d3712daf791489 /src/xmpp/xmpp_component.cpp | |
parent | f5b61f0feba271770474c4d540d7bf48a6c2b180 (diff) | |
download | biboumi-4e27298b3a6389781893589b37f66260d6a34707.tar.gz biboumi-4e27298b3a6389781893589b37f66260d6a34707.tar.bz2 biboumi-4e27298b3a6389781893589b37f66260d6a34707.tar.xz biboumi-4e27298b3a6389781893589b37f66260d6a34707.zip |
Add an ad-hoc command to disconnect some users
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r-- | src/xmpp/xmpp_component.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index 9547e3a..81a3b4f 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -41,7 +41,8 @@ XmppComponent::XmppComponent(std::shared_ptr<Poller> poller, const std::string& served_hostname(hostname), secret(secret), authenticated(false), - doc_open(false) + doc_open(false), + adhoc_commands_handler(this) { this->parser.add_stream_open_callback(std::bind(&XmppComponent::on_remote_stream_open, this, std::placeholders::_1)); @@ -543,6 +544,26 @@ Bridge* XmppComponent::get_user_bridge(const std::string& user_jid) } } +Bridge* XmppComponent::find_user_bridge(const std::string& user_jid) +{ + try + { + return this->bridges.at(user_jid).get(); + } + catch (const std::out_of_range& exception) + { + return nullptr; + } +} + +std::list<Bridge*> XmppComponent::get_bridges() const +{ + std::list<Bridge*> res; + for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it) + res.push_back(it->second.get()); + return res; +} + void* XmppComponent::get_receive_buffer(const size_t size) const { return this->parser.get_buffer(size); |