summaryrefslogtreecommitdiff
path: root/louloulibs/xmpp/xmpp_component.hpp
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-12-21 21:25:17 +0100
committerJonas Smedegaard <dr@jones.dk>2016-12-21 21:25:17 +0100
commitdc1ad45aea9a10007a31ae449b1e0fe352a8a6cd (patch)
treeeb233ce97fc828e2edba69a82a1e7314b92771d3 /louloulibs/xmpp/xmpp_component.hpp
parenta077b304b27d21bf635ef4f31a2a0447d3b14d11 (diff)
parentf820d86aadb7a5473bcc0a0a3669732ab0182555 (diff)
downloadbiboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.tar.gz
biboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.tar.bz2
biboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.tar.xz
biboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.zip
Merge tag 'upstream/4.0'
Upstream version 4.0 # gpg: Signature made Wed Dec 21 21:25:11 2016 CET # gpg: using RSA key 2C7C3146C1A00121 # gpg: Good signature from "Jonas Smedegaard <dr@jones.dk>" # gpg: aka "Jonas Smedegaard <jonas@homebase.dk>" # gpg: aka "Jonas Smedegaard <js@debian.org>" # gpg: aka "[jpeg image of size 4165]"
Diffstat (limited to 'louloulibs/xmpp/xmpp_component.hpp')
-rw-r--r--louloulibs/xmpp/xmpp_component.hpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/louloulibs/xmpp/xmpp_component.hpp b/louloulibs/xmpp/xmpp_component.hpp
index 5fc6d2e..5f5f937 100644
--- a/louloulibs/xmpp/xmpp_component.hpp
+++ b/louloulibs/xmpp/xmpp_component.hpp
@@ -9,6 +9,7 @@
#include <unordered_map>
#include <memory>
#include <string>
+#include <ctime>
#include <map>
#define STREAM_NS "http://etherx.jabber.org/streams"
@@ -25,6 +26,13 @@
#define VERSION_NS "jabber:iq:version"
#define ADHOC_NS "http://jabber.org/protocol/commands"
#define PING_NS "urn:xmpp:ping"
+#define DELAY_NS "urn:xmpp:delay"
+#define MAM_NS "urn:xmpp:mam:1"
+#define FORWARD_NS "urn:xmpp:forward:0"
+#define CLIENT_NS "jabber:client"
+#define DATAFORM_NS "jabber:x:data"
+#define RSM_NS "http://jabber.org/protocol/rsm"
+#define MUC_TRAFFIC_NS "http://jabber.org/protocol/muc#traffic"
/**
* An XMPP component, communicating with an XMPP server using the protocole
@@ -101,9 +109,8 @@ public:
* If fulljid is false, the provided 'from' doesn't contain the
* server-part of the JID and must be added.
*/
- void send_message(const std::string& from, Xmpp::body&& body,
- const std::string& to, const std::string& type,
- const bool fulljid=false);
+ void send_message(const std::string& from, Xmpp::body&& body, const std::string& to,
+ const std::string& type, const bool fulljid, const bool nocopy=false);
/**
* Send a join from a new participant
*/
@@ -121,12 +128,6 @@ public:
const std::string& nick,
const std::string& to);
/**
- * Send an error to indicate that the user tried to send a message to an
- * invalid user.
- */
- void send_invalid_user_error(const std::string& user_name,
- const std::string& to);
- /**
* Send the MUC topic to the user
*/
void send_topic(const std::string& from, Xmpp::body&& xmpp_topic, const std::string& to, const std::string& who);
@@ -135,6 +136,11 @@ public:
*/
void send_muc_message(const std::string& muc_name, const std::string& nick, Xmpp::body&& body, const std::string& jid_to);
/**
+ * Send a message, with a <delay/> element, part of a MUC history
+ */
+ void send_history_message(const std::string& muc_name, const std::string& nick, const std::string& body,
+ const std::string& jid_to, const std::time_t timestamp);
+ /**
* Send an unavailable presence for this nick
*/
void send_muc_leave(const std::string& muc_name, std::string&& nick, Xmpp::body&& message, const std::string& jid_to, const bool self);
@@ -151,11 +157,8 @@ public:
/**
* An user is kicked from a room
*/
- void kick_user(const std::string& muc_name,
- const std::string& target,
- const std::string& reason,
- const std::string& author,
- const std::string& jid_to);
+ void kick_user(const std::string& muc_name, const std::string& target, const std::string& reason,
+ const std::string& author, const std::string& jid_to, const bool self);
/**
* Send a generic presence error
*/
@@ -208,6 +211,9 @@ public:
virtual void after_handshake() {}
+ const std::string& get_served_hostname() const
+ { return this->served_hostname; }
+
/**
* Whether or not we ever succeeded our authentication to the XMPP server
*/