Implement the support for adhoc commands

We have two basic example commands. But it’s not entirely finished because
there are some error checks that we don’t do.

ref #2521
This commit is contained in:
Florent Le Coz
2014-05-30 03:58:17 +02:00
parent 1c93afc9a7
commit eb9a201870
8 changed files with 370 additions and 5 deletions
+7
View File
@@ -1,6 +1,7 @@
#ifndef XMPP_COMPONENT_INCLUDED
# define XMPP_COMPONENT_INCLUDED
#include <xmpp/adhoc_commands_handler.hpp>
#include <network/socket_handler.hpp>
#include <xmpp/xmpp_parser.hpp>
#include <bridge/bridge.hpp>
@@ -177,6 +178,11 @@ public:
* Send a result IQ with the gateway disco informations.
*/
void send_self_disco_info(const std::string& id, const std::string& jid_to);
/**
* Send the list of all available ad-hoc commands to that JID. The list is
* different depending on what JID made the request.
*/
void send_adhoc_commands_list(const std::string& id, const std::string& requester_jid);
/**
* Send an iq version request
*/
@@ -231,6 +237,7 @@ private:
static unsigned long current_id;
AdhocCommandsHandler adhoc_commands_handler;
XmppComponent(const XmppComponent&) = delete;
XmppComponent(XmppComponent&&) = delete;
XmppComponent& operator=(const XmppComponent&) = delete;