summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-04-28 08:15:17 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-04-28 08:17:18 +0300
commit5e61d6cc38062d88bcf0c7057b6c1c72cd265622 (patch)
treed09dea542e855773bed0f9530319d7ba9af9ea3f /protocols
parent77d5da22c96501bb51a348afee5aed48a02d1956 (diff)
protocols: jabber: xep-0198
- keep contacts status for session resume if resume is possible - reset status only if resume failed
Diffstat (limited to 'protocols')
-rwxr-xr-xprotocols/JabberG/src/jabber_strm_mgmt.cpp5
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp11
2 files changed, 12 insertions, 4 deletions
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;