From 73432d343884b943bae834e03ce68a8677fe932e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 14 Sep 2022 02:09:07 -0700 Subject: useless field ThreadData::bIsSessionAvailable removed --- protocols/JabberG/src/jabber_iqid.cpp | 8 +++++--- protocols/JabberG/src/jabber_strm_mgmt.cpp | 4 ---- protocols/JabberG/src/jabber_thread.cpp | 3 --- protocols/JabberG/src/stdafx.h | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 9ec0dfee1e..df222552fa 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -389,6 +389,7 @@ void CJabberProto::OnIqResultBind(const TiXmlElement *iqNode, CJabberIqInfo *pIn { if (!m_ThreadInfo || !iqNode) return; + if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) { const char *szJid = XmlGetChildText(XmlGetChildByTag(iqNode, "bind", "xmlns", JABBER_FEAT_BIND), "jid"); if (szJid) { @@ -399,12 +400,13 @@ void CJabberProto::OnIqResultBind(const TiXmlElement *iqNode, CJabberIqInfo *pIn strncpy_s(m_ThreadInfo->fullJID, szJid, _TRUNCATE); } } - if (m_ThreadInfo->bIsSessionAvailable) + + if (m_isSessionAvailable) { m_ThreadInfo->send( XmlNodeIq(AddIQ(&CJabberProto::OnIqResultSession, JABBER_IQ_TYPE_SET)) << XCHILDNS("session", "urn:ietf:params:xml:ns:xmpp-session")); - else - OnLoggedIn(); + } + else OnLoggedIn(); } else { //rfc3920 page 39 diff --git a/protocols/JabberG/src/jabber_strm_mgmt.cpp b/protocols/JabberG/src/jabber_strm_mgmt.cpp index cbba6b5daa..e0f95eb2a8 100644 --- a/protocols/JabberG/src/jabber_strm_mgmt.cpp +++ b/protocols/JabberG/src/jabber_strm_mgmt.cpp @@ -301,10 +301,6 @@ void strm_mgmt::FinishLoginProcess(ThreadData *info) XmlNodeIq(proto->AddIQ(&CJabberProto::OnIqResultBind, JABBER_IQ_TYPE_SET)) << XCHILDNS("bind", JABBER_FEAT_BIND) << XCHILD("resource", info->resource)); - - if (proto->m_isSessionAvailable) - info->bIsSessionAvailable = true; - return; } diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 9a11faba97..292f36e7bc 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -737,9 +737,6 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info) XmlNodeIq(AddIQ(&CJabberProto::OnIqResultBind, JABBER_IQ_TYPE_SET)) << XCHILDNS("bind", JABBER_FEAT_BIND) << XCHILD("resource", info->resource)); - - if (m_isSessionAvailable) - info->bIsSessionAvailable = true; } else // mechanisms are not available and we are not logged in PerformIqAuth(info); diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 6147577fa3..dc0dc76647 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -368,7 +368,7 @@ struct ThreadData // features & registration bool bIsReg; - bool reg_done, bIsSessionAvailable; + bool reg_done; bool bBookmarksLoaded; uint32_t dwLoginRqs; -- cgit v1.2.3