From 8de2f467bba5976ade5071193eed07fc7ca098ed Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 30 Jan 2013 06:47:14 +0000 Subject: added platform caps git-svn-id: http://svn.miranda-ng.org/main/trunk@3351 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber.cpp | 7 ++++++- protocols/JabberG/src/jabber_caps.cpp | 2 ++ protocols/JabberG/src/jabber_caps.h | 6 +++++- protocols/JabberG/src/jabber_misc.cpp | 12 ++++++++++++ protocols/JabberG/src/jabber_util.cpp | 12 +++++++++++- 5 files changed, 36 insertions(+), 3 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 10525342ea..180eae9895 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -78,7 +78,7 @@ HANDLE hExtraMood = NULL; void JabberUserInfoInit(void); -int bSecureIM, bMirOTR, bNewGPG; +int bSecureIM, bMirOTR, bNewGPG, bPlatform; ///////////////////////////////////////////////////////////////////////////// // Protocol instances @@ -152,6 +152,11 @@ static int OnModulesLoaded(WPARAM, LPARAM) bSecureIM = (ServiceExists("SecureIM/IsContactSecured")); bMirOTR = (int)GetModuleHandle(_T("mirotr.dll")); bNewGPG = (int)GetModuleHandle(_T("new_gpg.dll")); + #ifdef WIN64 + bPlatform = 1; + #else + bPlatform = 0; + #endif // file associations manager plugin support if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) { diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index 5f5fb36346..53174f19ff 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -88,6 +88,8 @@ const JabberFeatCapPair g_JabberFeatCapPairsExt[] = { { _T(JABBER_EXT_GTALK_PMUC), JABBER_CAPS_GTALK_PMUC }, { _T(JABBER_EXT_MIR_NOTES), JABBER_CAPS_MIRANDA_NOTES, }, { szCoreVersion, JABBER_CAPS_MIRANDA_PARTIAL }, + { _T(JABBER_EXT_PLATFORMX86), JABBER_CAPS_PLATFORMX86 }, + { _T(JABBER_EXT_PLATFORMX64), JABBER_CAPS_PLATFORMX64 }, { NULL, 0 } }; diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h index 29547c1ff5..6a1d8c7a55 100644 --- a/protocols/JabberG/src/jabber_caps.h +++ b/protocols/JabberG/src/jabber_caps.h @@ -108,6 +108,8 @@ typedef unsigned __int64 JabberCapsBits; #define JABBER_CAPS_MIROTR ((JabberCapsBits)1<<42) #define JABBER_FEAT_NEWGPG "http://miranda-ng.org/caps/new_gpg" #define JABBER_CAPS_NEWGPG ((JabberCapsBits)1<<43) +#define JABBER_CAPS_PLATFORMX86 ((JabberCapsBits)1<<44) +#define JABBER_CAPS_PLATFORMX64 ((JabberCapsBits)1<<45) #define JABBER_FEAT_PRIVACY_LISTS "jabber:iq:privacy" #define JABBER_CAPS_PRIVACY_LISTS ((JabberCapsBits)1<<29) #define JABBER_FEAT_MESSAGE_RECEIPTS "urn:xmpp:receipts" @@ -152,7 +154,7 @@ typedef unsigned __int64 JabberCapsBits; #define JABBER_CAPS_OTHER_SPECIAL (JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY|JABBER_RESOURCE_CAPS_ERROR) // must contain all the caps not listed in g_JabberFeatCapPairs, to prevent using these bits for features registered through IJabberNetInterface::RegisterFeature() #define JABBER_CAPS_MIRANDA_NODE "http://miranda-ng.org/caps" -#define JABBER_CAPS_MIRANDA_ALL (JABBER_CAPS_DISCO_INFO|JABBER_CAPS_DISCO_ITEMS|JABBER_CAPS_MUC|JABBER_CAPS_ENTITY_CAPS|JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_BYTESTREAMS|JABBER_CAPS_IBB|JABBER_CAPS_OOB|JABBER_CAPS_CHATSTATES|JABBER_CAPS_AGENTS|JABBER_CAPS_BROWSE|JABBER_CAPS_VERSION|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_VCARD_TEMP|JABBER_CAPS_ENTITY_TIME|JABBER_CAPS_PING|JABBER_CAPS_PRIVACY_LISTS|JABBER_CAPS_MESSAGE_RECEIPTS|JABBER_CAPS_PRIVATE_STORAGE|JABBER_CAPS_ATTENTION_0|JABBER_CAPS_JINGLE|JABBER_CAPS_ROSTER_EXCHANGE|JABBER_CAPS_SECUREIM|JABBER_CAPS_MIROTR|JABBER_CAPS_NEWGPG|JABBER_CAPS_COMMANDS|JABBER_CAPS_USER_MOOD_NOTIFY|JABBER_CAPS_USER_TUNE_NOTIFY|JABBER_CAPS_USER_ACTIVITY_NOTIFY) +#define JABBER_CAPS_MIRANDA_ALL (JABBER_CAPS_DISCO_INFO|JABBER_CAPS_DISCO_ITEMS|JABBER_CAPS_MUC|JABBER_CAPS_ENTITY_CAPS|JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_BYTESTREAMS|JABBER_CAPS_IBB|JABBER_CAPS_OOB|JABBER_CAPS_CHATSTATES|JABBER_CAPS_AGENTS|JABBER_CAPS_BROWSE|JABBER_CAPS_VERSION|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_VCARD_TEMP|JABBER_CAPS_ENTITY_TIME|JABBER_CAPS_PING|JABBER_CAPS_PRIVACY_LISTS|JABBER_CAPS_MESSAGE_RECEIPTS|JABBER_CAPS_PRIVATE_STORAGE|JABBER_CAPS_ATTENTION_0|JABBER_CAPS_JINGLE|JABBER_CAPS_ROSTER_EXCHANGE|JABBER_CAPS_SECUREIM|JABBER_CAPS_MIROTR|JABBER_CAPS_NEWGPG|JABBER_CAPS_COMMANDS|JABBER_CAPS_USER_MOOD_NOTIFY|JABBER_CAPS_USER_TUNE_NOTIFY|JABBER_CAPS_USER_ACTIVITY_NOTIFY|JABBER_CAPS_PLATFORMX86|JABBER_CAPS_PLATFORMX64) #define JABBER_CAPS_MIRANDA_PARTIAL (JABBER_CAPS_DISCO_INFO|JABBER_CAPS_DISCO_ITEMS|JABBER_CAPS_MUC|JABBER_CAPS_ENTITY_CAPS|JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_BYTESTREAMS|JABBER_CAPS_IBB|JABBER_CAPS_OOB|JABBER_CAPS_CHATSTATES|JABBER_CAPS_AGENTS|JABBER_CAPS_BROWSE|JABBER_CAPS_VERSION|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_VCARD_TEMP|JABBER_CAPS_ENTITY_TIME|JABBER_CAPS_PING|JABBER_CAPS_PRIVACY_LISTS|JABBER_CAPS_MESSAGE_RECEIPTS|JABBER_CAPS_PRIVATE_STORAGE|JABBER_CAPS_ATTENTION_0|JABBER_CAPS_JINGLE|JABBER_CAPS_ROSTER_EXCHANGE) @@ -165,6 +167,8 @@ typedef unsigned __int64 JabberCapsBits; #define JABBER_EXT_USER_ACTIVITY "activity" #define JABBER_EXT_GTALK_PMUC "pmuc-v1" #define JABBER_EXT_MIR_NOTES "mir_notes" +#define JABBER_EXT_PLATFORMX86 "x86" +#define JABBER_EXT_PLATFORMX64 "x64" #define JABBER_FEAT_EXT_ADDRESSING "http://jabber.org/protocol/address" #define JABBER_FEAT_NESTED_ROSTER_GROUPS "roster:delimiter" diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index a714f16b08..237c844001 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -516,6 +516,18 @@ void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, in } // attach additional info for fingerprint plguin + if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_PLATFORMX86)) && !_tcsstr(buf, _T("x86"))) + { + int offset = lstrlen(buf); + mir_sntprintf(buf + offset, bufSize - offset, _T(" x86")); + } + + if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_PLATFORMX64)) && !_tcsstr(buf, _T("x64"))) + { + int offset = lstrlen(buf); + mir_sntprintf(buf + offset, bufSize - offset, _T(" x64")); + } + if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_SECUREIM)) && !_tcsstr(buf, _T("(SecureIM)"))) { int offset = lstrlen(buf); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 983f33392c..4790bde7e1 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern CRITICAL_SECTION mutex; -extern int bSecureIM, bMirOTR, bNewGPG; +extern int bSecureIM, bMirOTR, bNewGPG, bPlatform; void CJabberProto::SerialInit(void) { @@ -845,6 +845,16 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR _tcscat(szExtCaps, _T(JABBER_EXT_NEWGPG)); } + if (bPlatform) { + if (szExtCaps[0]) + _tcscat(szExtCaps, _T(" ")); + _tcscat(szExtCaps, _T(JABBER_EXT_PLATFORMX64)); + } else { + if (szExtCaps[0]) + _tcscat(szExtCaps, _T(" ")); + _tcscat(szExtCaps, _T(JABBER_EXT_PLATFORMX86)); + } + if (m_options.EnableRemoteControl) { if (szExtCaps[0]) _tcscat(szExtCaps, _T(" ")); -- cgit v1.2.3