summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp23
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);