summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-12-08 20:14:12 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-12-08 20:14:12 +0100
commitb11126a19dbaadf4c32fb8dbec22754ad0712c26 (patch)
tree140a9c33a264adfb4eee7a0e2add0b6c5ec1671c /src/xmpp/xmpp_component.cpp
parentcb718def0cb51aac4c2125e3864522740fcb2573 (diff)
downloadbiboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.tar.gz
biboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.tar.bz2
biboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.tar.xz
biboumi-b11126a19dbaadf4c32fb8dbec22754ad0712c26.zip
Provide a JID for IRC users, and add a stringprep dependency for this
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 5e65595..6424d74 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -267,7 +267,10 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con
this->send_stanza(node);
}
-void XmppComponent::send_user_join(const std::string& from, const std::string& nick, const std::string& to)
+void XmppComponent::send_user_join(const std::string& from,
+ const std::string& nick,
+ const std::string& realjid,
+ const std::string& to)
{
XmlNode node("presence");
node["to"] = to;
@@ -280,6 +283,12 @@ void XmppComponent::send_user_join(const std::string& from, const std::string& n
XmlNode item("item");
item["affiliation"] = "member";
item["role"] = "participant";
+ if (!realjid.empty())
+ {
+ const std::string preped_jid = jidprep(realjid);
+ if (!preped_jid.empty())
+ item["jid"] = preped_jid;
+ }
item.close();
x.add_child(std::move(item));
x.close();
@@ -408,7 +417,7 @@ void XmppComponent::send_nick_change(const std::string& muc_name, const std::str
if (self)
this->send_self_join(muc_name, new_nick, jid_to);
else
- this->send_user_join(muc_name, new_nick, jid_to);
+ this->send_user_join(muc_name, new_nick, "", jid_to);
}
void XmppComponent::kick_user(const std::string& muc_name,