summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-04-04 23:33:55 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-04-04 23:35:51 +0300
commit8721208a636712a2c014917d460ee2748225583b (patch)
tree42075338fd7c1f5c18dc64cd093fa67fc3c1b19e /protocols/JabberG/src
parent25fed4bccbac68ea89325025f9d08fcb5eb6b258 (diff)
protocols: jabber: xep-0198
- do not request roster on resumed session
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp27
-rwxr-xr-xprotocols/JabberG/src/jabber_strm_mgmt.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_strm_mgmt.h1
3 files changed, 22 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index c2d2d1313e..e98ae24c1e 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -179,24 +179,27 @@ void CJabberProto::OnLoggedIn()
m_ThreadInfo->dwLoginRqs = 0;
// XEP-0083 support
+ if (!(m_StrmMgmt.IsSessionResumed()))
{
- CJabberIqInfo *pIqInfo = AddIQ(&CJabberProto::OnIqResultNestedRosterGroups, JABBER_IQ_TYPE_GET);
- // ugly hack to prevent hangup during login process
- pIqInfo->SetTimeout(30000);
- m_ThreadInfo->send(
- XmlNodeIq(pIqInfo) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
+ {
+ CJabberIqInfo *pIqInfo = AddIQ(&CJabberProto::OnIqResultNestedRosterGroups, JABBER_IQ_TYPE_GET);
+ // ugly hack to prevent hangup during login process
+ pIqInfo->SetTimeout(30000);
+ m_ThreadInfo->send(
+ XmlNodeIq(pIqInfo) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
<< XCHILDNS(L"roster", JABBER_FEAT_NESTED_ROSTER_GROUPS));
- }
+ }
- // Server-side notes
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultNotes, JABBER_IQ_TYPE_GET))
+ // Server-side notes
+ m_ThreadInfo->send(
+ XmlNodeIq(AddIQ(&CJabberProto::OnIqResultNotes, JABBER_IQ_TYPE_GET))
<< XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
<< XCHILDNS(L"storage", JABBER_FEAT_MIRANDA_NOTES));
-
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultDiscoBookmarks, JABBER_IQ_TYPE_GET))
+
+ m_ThreadInfo->send(
+ XmlNodeIq(AddIQ(&CJabberProto::OnIqResultDiscoBookmarks, JABBER_IQ_TYPE_GET))
<< XQUERY(JABBER_FEAT_PRIVATE_STORAGE) << XCHILDNS(L"storage", L"storage:bookmarks"));
+ }
m_bPepSupported = false;
m_ThreadInfo->jabberServerCaps = JABBER_RESOURCE_CAPS_NONE;
diff --git a/protocols/JabberG/src/jabber_strm_mgmt.cpp b/protocols/JabberG/src/jabber_strm_mgmt.cpp
index 6fa7afcf84..b05b0b3cbb 100755
--- a/protocols/JabberG/src/jabber_strm_mgmt.cpp
+++ b/protocols/JabberG/src/jabber_strm_mgmt.cpp
@@ -46,6 +46,7 @@ void strm_mgmt::OnProcessEnabled(HXML node, ThreadData * /*info*/)
m_sStrmMgmtResumeId = XmlGetAttrValue(node, L"id");
}
}
+ //TODO: handle 'location'
m_nStrmMgmtLocalHCount = 0;
m_nStrmMgmtSrvHCount = 0;
}
@@ -240,4 +241,9 @@ void strm_mgmt::SendAck()
XmlAddAttr(enable_sm, L"xmlns", L"urn:xmpp:sm:3");
xmlAddAttrInt(enable_sm, L"h", m_nStrmMgmtLocalHCount);
proto->m_ThreadInfo->send_no_strm_mgmt(enable_sm);
+}
+
+bool strm_mgmt::IsSessionResumed()
+{
+ return bSessionResumed;
} \ No newline at end of file
diff --git a/protocols/JabberG/src/jabber_strm_mgmt.h b/protocols/JabberG/src/jabber_strm_mgmt.h
index 10a659cde3..b59e3a332b 100755
--- a/protocols/JabberG/src/jabber_strm_mgmt.h
+++ b/protocols/JabberG/src/jabber_strm_mgmt.h
@@ -53,6 +53,7 @@ public:
void CheckState();
void OnDisconnect();
void SendAck();
+ bool IsSessionResumed();
};
#endif //JABBER_STRM_MGMT_H \ No newline at end of file