diff options
author | George Hazan <ghazan@miranda.im> | 2016-10-19 11:44:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-10-19 11:44:36 +0300 |
commit | 33832a25f64efd62cedfbf1b670820a07dd870f5 (patch) | |
tree | 978a81a110930b0f207f4d11e72f3f4ac820b903 /protocols | |
parent | de812d7c8e61a45025a498fd23b7d7502cf0e866 (diff) |
we don't publish version in caps if version requests are not allowed
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index c2083fb050..d5a3c372dc 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -384,53 +384,55 @@ void CJabberProto::SendPresenceTo(int status, const wchar_t* to, HXML extra, con XmlAddChild(p, extra);
// XEP-0115:Entity Capabilities
- HXML c = p << XCHILDNS(L"c", JABBER_FEAT_ENTITY_CAPS) << XATTR(L"node", JABBER_CAPS_MIRANDA_NODE)
- << XATTR(L"ver", szCoreVersion);
+ if (m_options.AllowVersionRequests) {
+ HXML c = p << XCHILDNS(L"c", JABBER_FEAT_ENTITY_CAPS) << XATTR(L"node", JABBER_CAPS_MIRANDA_NODE)
+ << XATTR(L"ver", szCoreVersion);
- LIST<wchar_t> arrExtCaps(5);
- if (bSecureIM)
- arrExtCaps.insert(JABBER_EXT_SECUREIM);
+ LIST<wchar_t> arrExtCaps(5);
+ if (bSecureIM)
+ arrExtCaps.insert(JABBER_EXT_SECUREIM);
- if (bMirOTR)
- arrExtCaps.insert(JABBER_EXT_MIROTR);
+ if (bMirOTR)
+ arrExtCaps.insert(JABBER_EXT_MIROTR);
- if (bNewGPG)
- arrExtCaps.insert(JABBER_EXT_NEWGPG);
+ if (bNewGPG)
+ arrExtCaps.insert(JABBER_EXT_NEWGPG);
- if (bPlatform)
- arrExtCaps.insert(JABBER_EXT_PLATFORMX64);
- else
- arrExtCaps.insert(JABBER_EXT_PLATFORMX86);
+ if (bPlatform)
+ arrExtCaps.insert(JABBER_EXT_PLATFORMX64);
+ else
+ arrExtCaps.insert(JABBER_EXT_PLATFORMX86);
- if (m_options.EnableRemoteControl)
- arrExtCaps.insert(JABBER_EXT_COMMANDS);
+ if (m_options.EnableRemoteControl)
+ arrExtCaps.insert(JABBER_EXT_COMMANDS);
- if (m_options.EnableUserMood)
- arrExtCaps.insert(JABBER_EXT_USER_MOOD);
+ if (m_options.EnableUserMood)
+ arrExtCaps.insert(JABBER_EXT_USER_MOOD);
- if (m_options.EnableUserTune)
- arrExtCaps.insert(JABBER_EXT_USER_TUNE);
+ if (m_options.EnableUserTune)
+ arrExtCaps.insert(JABBER_EXT_USER_TUNE);
- if (m_options.EnableUserActivity)
- arrExtCaps.insert(JABBER_EXT_USER_ACTIVITY);
+ if (m_options.EnableUserActivity)
+ arrExtCaps.insert(JABBER_EXT_USER_ACTIVITY);
- if (m_options.AcceptNotes)
- arrExtCaps.insert(JABBER_EXT_MIR_NOTES);
+ if (m_options.AcceptNotes)
+ arrExtCaps.insert(JABBER_EXT_MIR_NOTES);
- NotifyFastHook(hExtListInit, (WPARAM)&arrExtCaps, (LPARAM)(IJabberInterface*)this);
+ NotifyFastHook(hExtListInit, (WPARAM)&arrExtCaps, (LPARAM)(IJabberInterface*)this);
- // add features enabled through IJabberNetInterface::AddFeatures()
- for (int i = 0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
- if (m_uEnabledFeatCapsDynamic & m_lstJabberFeatCapPairsDynamic[i]->jcbCap)
- arrExtCaps.insert(m_lstJabberFeatCapPairsDynamic[i]->szExt);
+ // add features enabled through IJabberNetInterface::AddFeatures()
+ for (int i = 0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
+ if (m_uEnabledFeatCapsDynamic & m_lstJabberFeatCapPairsDynamic[i]->jcbCap)
+ arrExtCaps.insert(m_lstJabberFeatCapPairsDynamic[i]->szExt);
- if (arrExtCaps.getCount()) {
- CMStringW szExtCaps = arrExtCaps[0];
- for (int i = 1; i < arrExtCaps.getCount(); i++) {
- szExtCaps.AppendChar(' ');
- szExtCaps += arrExtCaps[i];
+ if (arrExtCaps.getCount()) {
+ CMStringW szExtCaps = arrExtCaps[0];
+ for (int i = 1; i < arrExtCaps.getCount(); i++) {
+ szExtCaps.AppendChar(' ');
+ szExtCaps += arrExtCaps[i];
+ }
+ XmlAddAttr(c, L"ext", szExtCaps);
}
- XmlAddAttr(c, L"ext", szExtCaps);
}
if (m_options.EnableAvatars) {
|