summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_util.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-26 00:26:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-26 00:26:13 +0300
commit1bf0fece31876c453bea93479e6d0d40bd8a564d (patch)
treeed0361cc6c51ec8c0c74829df6d24d2a22e70f45 /protocols/JabberG/src/jabber_util.cpp
parentea88e2c53d3ac0840955eb703213ca1430bb4361 (diff)
fixes #1865 (Joining Password Protected Jabber Conference is not working since last updates) + code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 659d3b391f..7ae125f069 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -301,7 +301,7 @@ void CJabberProto::SendVisibleInvisiblePresence(bool invisible)
if (invisible && apparentMode == ID_STATUS_OFFLINE)
m_ThreadInfo->send(XmlNode("presence") << XATTR("to", item->jid) << XATTR("type", "invisible"));
else if (!invisible && apparentMode == ID_STATUS_ONLINE)
- SendPresenceTo(m_iStatus, item->jid, nullptr);
+ SendPresenceTo(m_iStatus, item->jid);
}
}
@@ -356,7 +356,7 @@ time_t JabberIsoToUnixTime(const char *stamp)
return (t >= 0) ? t : 0;
}
-void CJabberProto::SendPresenceTo(int status, const char *to, TiXmlElement *extra, const char *msg)
+void CJabberProto::SendPresenceTo(int status, const char *to, const TiXmlElement *extra, const char *msg)
{
if (!m_bJabberOnline) return;
@@ -372,7 +372,7 @@ void CJabberProto::SendPresenceTo(int status, const char *to, TiXmlElement *extr
p << XATTR("to", to);
if (extra)
- p.InsertEndChild(extra);
+ p.InsertEndChild(extra->DeepClone(&p)->ToElement());
// XEP-0115:Entity Capabilities
if (m_bAllowVersionRequests) {
@@ -486,7 +486,7 @@ void CJabberProto::SendPresenceTo(int status, const char *to, TiXmlElement *extr
void CJabberProto::SendPresence(int status, bool bSendToAll)
{
- SendPresenceTo(status, nullptr, nullptr);
+ SendPresenceTo(status, nullptr);
SendVisibleInvisiblePresence(status == ID_STATUS_INVISIBLE);
// Also update status in all chatrooms
@@ -497,7 +497,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
if (item != nullptr && item->nick != nullptr) {
char text[1024];
mir_snprintf(text, "%s/%s", item->jid, item->nick);
- SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text, nullptr);
+ SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text);
}
}
}