summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.hpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-06 22:39:09 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-06 22:39:09 +0200
commitf35db5cebaf1b9e267a7f2341699bb50fbc54c65 (patch)
tree25b6538c8b3520fb6bd362d367084271f5121c61 /src/xmpp/xmpp_component.hpp
parent18b27793de8863f58b284ee791a8207a79738b85 (diff)
downloadbiboumi-f35db5cebaf1b9e267a7f2341699bb50fbc54c65.tar.gz
biboumi-f35db5cebaf1b9e267a7f2341699bb50fbc54c65.tar.bz2
biboumi-f35db5cebaf1b9e267a7f2341699bb50fbc54c65.tar.xz
biboumi-f35db5cebaf1b9e267a7f2341699bb50fbc54c65.zip
Implement next_id() to
Diffstat (limited to 'src/xmpp/xmpp_component.hpp')
-rw-r--r--src/xmpp/xmpp_component.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp
index aa19be3..f54ebd7 100644
--- a/src/xmpp/xmpp_component.hpp
+++ b/src/xmpp/xmpp_component.hpp
@@ -20,10 +20,16 @@ class XmppComponent: public SocketHandler
public:
explicit XmppComponent(const std::string& hostname, const std::string& secret);
~XmppComponent();
+
void on_connection_failed(const std::string& reason) override final;
void on_connected() override final;
void on_connection_close() override final;
void parse_in_buffer(const size_t size) override final;
+
+ /**
+ * Returns a unique id, to be used in the 'id' element of our iq stanzas.
+ */
+ static std::string next_id();
/**
* Send a "close" message to all our connected peers. That message
* depends on the protocol used (this may be a QUIT irc message, or a
@@ -195,6 +201,8 @@ private:
*/
std::unordered_map<std::string, std::unique_ptr<Bridge>> bridges;
+ static unsigned long current_id;
+
XmppComponent(const XmppComponent&) = delete;
XmppComponent(XmppComponent&&) = delete;
XmppComponent& operator=(const XmppComponent&) = delete;
@@ -202,4 +210,3 @@ private:
};
#endif // XMPP_COMPONENT_INCLUDED
-