summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/xmpp_component.cpp4
-rw-r--r--src/xmpp/xmpp_component.hpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 2799a21..85a83de 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -457,11 +457,13 @@ void* XmppComponent::get_receive_buffer(const size_t size) const
return this->parser.get_buffer(size);
}
-void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, const std::string& to)
+void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, const std::string& to, const std::string& type)
{
XmlNode node("message");
node["to"] = to;
node["from"] = from + "@" + this->served_hostname;
+ if (!type.empty())
+ node["type"] = type;
XmlNode body_node("body");
body_node.set_inner(std::get<0>(body));
body_node.close();
diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp
index 5a5d3d8..3e13086 100644
--- a/src/xmpp/xmpp_component.hpp
+++ b/src/xmpp/xmpp_component.hpp
@@ -81,7 +81,8 @@ public:
/**
* Send a message from from@served_hostname, with the given body
*/
- void send_message(const std::string& from, Xmpp::body&& body, const std::string& to);
+ void send_message(const std::string& from, Xmpp::body&& body,
+ const std::string& to, const std::string& type);
/**
* Send a join from a new participant
*/