diff options
author | George Hazan <ghazan@miranda.im> | 2017-08-10 19:14:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-08-10 19:14:19 +0300 |
commit | 3d83eeec481c25253e2535e7ce9476e3f046123a (patch) | |
tree | c0cc9f3ffc49a79f510fcff8658fb9baaba99605 /protocols/JabberG/src/jabber_proto.cpp | |
parent | e98d9da63ab340e4fdaf2fa2cd4037e4b7f0a498 (diff) |
Jabber:
- more fixes for XEP-115 support;
- obsolete code removed;
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 4743906a8a..866bd1b030 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -544,7 +544,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, MCONTACT hContact) case PFLAG_MAXCONTACTSPERPACKET:
wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (GetClientJID(hContact, szClientJid, _countof(szClientJid))) {
- JabberCapsBits jcb = GetResourceCapabilites(szClientJid, TRUE);
+ JabberCapsBits jcb = GetResourceCapabilites(szClientJid, true);
return ((~jcb & JABBER_CAPS_ROSTER_EXCHANGE) ? 0 : 50);
}
}
@@ -602,17 +602,11 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) mir_snwprintf(tmp, L"%s/%s", szBareJid, r->m_tszResourceName);
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));
+ XmlNodeIq iq5(AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT));
iq5 << XQUERY(JABBER_FEAT_DISCO_INFO);
m_ThreadInfo->send(iq5);
}
- if (r->m_dwVersionRequestTime == 0) {
- XmlNodeIq iq4(AddIQ(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE));
- iq4 << XQUERY(JABBER_FEAT_VERSION);
- m_ThreadInfo->send(iq4);
- }
-
if (!mir_wstrcmp(tmp, jid)) {
XmlNodeIq iq3(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM));
iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY);
@@ -620,11 +614,6 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) }
}
}
- else if (item->getTemp()->m_dwVersionRequestTime == 0) {
- XmlNodeIq iq4(AddIQ(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, item->jid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE));
- iq4 << XQUERY(JABBER_FEAT_VERSION);
- m_ThreadInfo->send(iq4);
- }
}
}
@@ -783,7 +772,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC if (!GetClientJID(hContact, szClientJid, _countof(szClientJid)))
return 0;
- JabberCapsBits jcb = GetResourceCapabilites(szClientJid, TRUE);
+ JabberCapsBits jcb = GetResourceCapabilites(szClientJid, true);
if (~jcb & JABBER_CAPS_ROSTER_EXCHANGE)
return 0;
@@ -824,10 +813,10 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri if (item->ft != NULL)
return 0;
- JabberCapsBits jcb = GetResourceCapabilites(item->jid, TRUE);
+ JabberCapsBits jcb = GetResourceCapabilites(item->jid, true);
if (jcb == JABBER_RESOURCE_CAPS_IN_PROGRESS) {
Sleep(600);
- jcb = GetResourceCapabilites(item->jid, TRUE);
+ jcb = GetResourceCapabilites(item->jid, true);
}
// fix for very smart clients, like gajim
@@ -983,9 +972,9 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) pResourceStatus r(ResourceInfoFromJID(szClientJid));
if (r)
- r->m_bMessageSessionActive = TRUE;
+ r->m_bMessageSessionActive = true;
- JabberCapsBits jcb = GetResourceCapabilites(szClientJid, TRUE);
+ JabberCapsBits jcb = GetResourceCapabilites(szClientJid, true);
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
jcb = JABBER_RESOURCE_CAPS_NONE;
@@ -1001,7 +990,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) // if message sent to groupchat
!mir_wstrcmp(msgType, L"groupchat") ||
// if message delivery check disabled in settings
- !m_options.MsgAck || !getByte(hContact, "MsgAck", TRUE))
+ !m_options.MsgAck || !getByte(hContact, "MsgAck", true))
{
if (!mir_wstrcmp(msgType, L"groupchat"))
XmlAddAttr(m, L"to", szClientJid);
@@ -1239,7 +1228,7 @@ int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type) if (item == NULL)
return 0;
- JabberCapsBits jcb = GetResourceCapabilites(szClientJid, TRUE);
+ JabberCapsBits jcb = GetResourceCapabilites(szClientJid, true);
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
jcb = JABBER_RESOURCE_CAPS_NONE;
|