From 1bf0fece31876c453bea93479e6d0d40bd8a564d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Feb 2019 00:26:13 +0300 Subject: fixes #1865 (Joining Password Protected Jabber Conference is not working since last updates) + code cleaning --- protocols/JabberG/src/jabber_util.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/JabberG/src/jabber_util.cpp') 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); } } } -- cgit v1.2.3