From 5e61d6cc38062d88bcf0c7057b6c1c72cd265622 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 28 Apr 2018 08:15:17 +0300 Subject: protocols: jabber: xep-0198 - keep contacts status for session resume if resume is possible - reset status only if resume failed --- protocols/JabberG/src/jabber_strm_mgmt.cpp | 5 +++++ protocols/JabberG/src/jabber_thread.cpp | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_strm_mgmt.cpp b/protocols/JabberG/src/jabber_strm_mgmt.cpp index 1856997270..025dff2395 100755 --- a/protocols/JabberG/src/jabber_strm_mgmt.cpp +++ b/protocols/JabberG/src/jabber_strm_mgmt.cpp @@ -167,6 +167,11 @@ void strm_mgmt::OnProcessFailed(HXML node, ThreadData * info) //used failed inst m_bStrmMgmtEnabled = false; bSessionResumed = false; m_sStrmMgmtResumeId.clear(); + + //resume failed, reset contacts status + for (auto &hContact : proto->AccContacts()) + proto->SetContactOfflineStatus(hContact); + { HXML subnode = XmlGetChild(node, L"item-not-found"); if (subnode) diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 0c6757ce88..de7141ecf6 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -532,10 +532,13 @@ recvRest: m_StrmMgmt.OnDisconnect(); // Set all contacts to offline - debugLogA("1"); - for (auto &hContact : AccContacts()) - SetContactOfflineStatus(hContact); - debugLogA("2"); + if (!m_StrmMgmt.IsResumeIdPresent()) + { + debugLogA("1"); + for (auto &hContact : AccContacts()) + SetContactOfflineStatus(hContact); + debugLogA("2"); + } mir_free(m_szJabberJID); m_szJabberJID = nullptr; -- cgit v1.2.3