From a7c76155fdb8b92e57912195f14bec579260424f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 5 Mar 2014 17:41:23 +0000 Subject: Jabber: - chats require the resource to be specified; - resource info queries reordered not to produce duplicates git-svn-id: http://svn.miranda-ng.org/main/trunk@8416 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_proto.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index cff375efed..2d6434985b 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -646,6 +646,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) return 1; JabberStripJid(jid, szBareJid, SIZEOF(szBareJid)); + bool bUseResource = ListGetItemPtr(LIST_CHATROOM, szBareJid) != NULL; if (m_ThreadInfo) { m_ThreadInfo->send( @@ -681,12 +682,6 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) pResourceStatus r(item->arResources[i]); TCHAR tmp[JABBER_MAX_JID_LEN]; mir_sntprintf(tmp, SIZEOF(tmp), _T("%s/%s"), szBareJid, r->m_tszResourceName); - if (!_tcscmp(tmp, jid)) - continue; - - XmlNodeIq iq3(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM)); - iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY); - m_ThreadInfo->send(iq3); if (r->m_jcbCachedCaps & JABBER_CAPS_DISCO_INFO) { XmlNodeIq iq5(AddIQ(&CJabberProto::OnIqResultCapsDiscoInfoSI, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT)); @@ -699,6 +694,12 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) iq4 << XQUERY(JABBER_FEAT_VERSION); m_ThreadInfo->send(iq4); } + + if (!_tcscmp(tmp, jid)) { + XmlNodeIq iq3(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM)); + iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY); + m_ThreadInfo->send(iq3); + } } } else if (item->getTemp()->m_dwVersionRequestTime == 0) { @@ -709,7 +710,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) } } - SendGetVcard(szBareJid); + SendGetVcard(bUseResource ? jid : szBareJid); return 0; } -- cgit v1.2.3