Add an ad-hoc command to disconnect some users

This commit is contained in:
Florent Le Coz
2014-05-31 17:06:36 +02:00
parent f5b61f0feb
commit 4e27298b3a
7 changed files with 180 additions and 13 deletions
+11 -1
View File
@@ -41,6 +41,16 @@ public:
void on_connection_close() override final;
void parse_in_buffer(const size_t size) override final;
/**
* Returns the bridge for the given user. If it does not exist, return
* nullptr.
*/
Bridge* find_user_bridge(const std::string& user_jid);
/**
* Return a list of all the managed bridges.
*/
std::list<Bridge*> get_bridges() const;
/**
* Returns a unique id, to be used in the 'id' element of our iq stanzas.
*/
@@ -228,6 +238,7 @@ private:
bool doc_open;
std::unordered_map<std::string, std::function<void(const Stanza&)>> stanza_handlers;
AdhocCommandsHandler adhoc_commands_handler;
/**
* One bridge for each user of the component. Indexed by the user's full
@@ -235,7 +246,6 @@ private:
*/
std::unordered_map<std::string, std::unique_ptr<Bridge>> bridges;
AdhocCommandsHandler adhoc_commands_handler;
XmppComponent(const XmppComponent&) = delete;
XmppComponent(XmppComponent&&) = delete;
XmppComponent& operator=(const XmppComponent&) = delete;