summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index b3d925e..de9a7a6 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -298,8 +298,8 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con
{
XmlSubNode private_node(message, "private");
private_node["xmlns"] = "urn:xmpp:carbons:2";
- XmlSubNode nocopy(message, "no-copy");
- nocopy["xmlns"] = "urn:xmpp:hints";
+ XmlSubNode nocopy_node(message, "no-copy");
+ nocopy_node["xmlns"] = "urn:xmpp:hints";
}
if (muc_private)
{
@@ -340,8 +340,12 @@ void XmppComponent::send_user_join(const std::string& from,
if (self)
{
- XmlSubNode status(x, "status");
- status["code"] = "110";
+ XmlSubNode status_self(x, "status");
+ status_self["code"] = "110";
+ XmlSubNode status_nick_modified(x, "status");
+ status_nick_modified["code"] = "210";
+ XmlSubNode status_nonanonymous(x, "status");
+ status_nonanonymous["code"] = "100";
}
}
this->send_stanza(presence);
@@ -363,7 +367,7 @@ void XmppComponent::send_topic(const std::string& from, Xmpp::body&& topic, cons
this->send_stanza(message);
}
-void XmppComponent::send_muc_message(const std::string& muc_name, const std::string& nick, Xmpp::body&& xmpp_body, const std::string& jid_to, std::string uuid, std::string id)
+Stanza XmppComponent::make_muc_message(const std::string& muc_name, const std::string& nick, Xmpp::body&& xmpp_body, const std::string& jid_to, std::string uuid, std::string id)
{
Stanza message("message");
message["to"] = jid_to;
@@ -395,7 +399,7 @@ void XmppComponent::send_muc_message(const std::string& muc_name, const std::str
stanza_id["id"] = std::move(uuid);
}
- this->send_stanza(message);
+ return message;
}
#ifdef USE_DATABASE
@@ -477,6 +481,8 @@ void XmppComponent::send_nick_change(const std::string& muc_name,
x["xmlns"] = MUC_USER_NS;
XmlSubNode item(x, "item");
item["nick"] = new_nick;
+ item["affiliation"] = affiliation;
+ item["role"] = role;
XmlSubNode status(x, "status");
status["code"] = "303";
if (self)
@@ -588,8 +594,8 @@ void XmppComponent::send_version(const std::string& id, const std::string& jid_t
name.set_inner("biboumi");
}
{
- XmlSubNode version(query, "version");
- version.set_inner(SOFTWARE_VERSION);
+ XmlSubNode version_node(query, "version");
+ version_node.set_inner(SOFTWARE_VERSION);
}
{
XmlSubNode os(query, "os");