summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-07-01 07:45:35 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-07-01 07:45:35 +0300
commitc6df3a4627f2f49515672b30427274275adf361d (patch)
tree9b29b9445450a72c1cf128f03bd69ab508051c9b /protocols/JabberG/src
parent0d6ff4d0ed05a2a35cd7ade12e2c924704211bc8 (diff)
protocols: jabber: xep-0128
- force disable session resume on manual switch to offline ( closes #1444 ) //untested
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp1
-rwxr-xr-xprotocols/JabberG/src/jabber_strm_mgmt.cpp5
-rwxr-xr-xprotocols/JabberG/src/jabber_strm_mgmt.h2
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp7
4 files changed, 8 insertions, 7 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index b58441b70f..3f56ab5e9e 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -1130,6 +1130,7 @@ int CJabberProto::SetStatus(int iNewStatus)
m_iDesiredStatus = iNewStatus;
if (iNewStatus == ID_STATUS_OFFLINE) {
+ m_StrmMgmt.ResetState();
if (m_ThreadInfo) {
if(m_bEnableStreamMgmt)
m_StrmMgmt.SendAck();
diff --git a/protocols/JabberG/src/jabber_strm_mgmt.cpp b/protocols/JabberG/src/jabber_strm_mgmt.cpp
index 025dff2395..10a1172e70 100755
--- a/protocols/JabberG/src/jabber_strm_mgmt.cpp
+++ b/protocols/JabberG/src/jabber_strm_mgmt.cpp
@@ -213,14 +213,15 @@ void strm_mgmt::HandleOutgoingNode(HXML node)
RequestAck();
}
-void strm_mgmt::OnDisconnect()
+void strm_mgmt::ResetState()
{
- //TODO: following should be redone once resumption implemented
//reset state of stream management
m_bStrmMgmtEnabled = false;
m_bStrmMgmtPendingEnable = false;
//reset stream management h counters
m_nStrmMgmtLocalHCount = m_nStrmMgmtLocalSCount = m_nStrmMgmtSrvHCount = 0;
+ //clear resume id
+ m_sStrmMgmtResumeId.clear();
}
void strm_mgmt::HandleIncommingNode(HXML node)
diff --git a/protocols/JabberG/src/jabber_strm_mgmt.h b/protocols/JabberG/src/jabber_strm_mgmt.h
index 78d6ce3269..8572e65664 100755
--- a/protocols/JabberG/src/jabber_strm_mgmt.h
+++ b/protocols/JabberG/src/jabber_strm_mgmt.h
@@ -52,7 +52,7 @@ public:
void OnProcessFailed(HXML node, ThreadData * info);
void CheckStreamFeatures(HXML node);
void CheckState();
- void OnDisconnect();
+ void ResetState();
void SendAck();
void RequestAck();
bool IsSessionResumed();
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 38aae073ee..955ec35500 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -529,15 +529,14 @@ recvRest:
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
- m_StrmMgmt.OnDisconnect();
-
// Set all contacts to offline
if (!m_StrmMgmt.IsResumeIdPresent())
{
- debugLogA("1");
+ m_StrmMgmt.ResetState(); //fully reset strm_mgmt state
+// debugLogA("1"); //i think this log calls does not needed anymore ? //sss
for (auto &hContact : AccContacts())
SetContactOfflineStatus(hContact);
- debugLogA("2");
+// debugLogA("2");
}
mir_free(m_szJabberJID);