From 7e367862550616802b29a38067bbc1b49e81a10c Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 29 Jan 2013 12:22:13 +0000 Subject: added new_gpg caps git-svn-id: http://svn.miranda-ng.org/main/trunk@3336 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber.cpp | 3 ++- protocols/JabberG/src/jabber_caps.cpp | 2 ++ protocols/JabberG/src/jabber_caps.h | 5 ++++- protocols/JabberG/src/jabber_misc.cpp | 6 ++++++ protocols/JabberG/src/jabber_util.cpp | 8 +++++++- 5 files changed, 21 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 5d96216773..10525342ea 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; +int bSecureIM, bMirOTR, bNewGPG; ///////////////////////////////////////////////////////////////////////////// // Protocol instances @@ -151,6 +151,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) bSecureIM = (ServiceExists("SecureIM/IsContactSecured")); bMirOTR = (int)GetModuleHandle(_T("mirotr.dll")); + bNewGPG = (int)GetModuleHandle(_T("new_gpg.dll")); // 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 57ac7d77da..5f5fb36346 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -58,6 +58,7 @@ const JabberFeatCapPair g_JabberFeatCapPairs[] = { { _T(JABBER_FEAT_PUBSUB), JABBER_CAPS_PUBSUB, _T("Supports generic publish-subscribe functionality") }, { _T(JABBER_FEAT_SECUREIM), JABBER_CAPS_SECUREIM, _T("Supports SecureIM plugin for Miranda NG") }, { _T(JABBER_FEAT_MIROTR), JABBER_CAPS_MIROTR, _T("Supports MirOTR plugin for Miranda NG") }, + { _T(JABBER_FEAT_NEWGPG), JABBER_CAPS_NEWGPG, _T("Supports New_GPG plugin for Miranda NG") }, { _T(JABBER_FEAT_PRIVACY_LISTS), JABBER_CAPS_PRIVACY_LISTS, _T("Can block communications from particular other users using Privacy lists") }, { _T(JABBER_FEAT_MESSAGE_RECEIPTS), JABBER_CAPS_MESSAGE_RECEIPTS, _T("Supports Message Receipts") }, { _T(JABBER_FEAT_USER_TUNE), JABBER_CAPS_USER_TUNE, _T("Can report information about the music to which a user is listening") }, @@ -79,6 +80,7 @@ const JabberFeatCapPair g_JabberFeatCapPairs[] = { const JabberFeatCapPair g_JabberFeatCapPairsExt[] = { { _T(JABBER_EXT_SECUREIM), JABBER_CAPS_SECUREIM }, { _T(JABBER_EXT_MIROTR), JABBER_CAPS_MIROTR }, + { _T(JABBER_EXT_NEWGPG), JABBER_CAPS_NEWGPG }, { _T(JABBER_EXT_COMMANDS), JABBER_CAPS_COMMANDS }, { _T(JABBER_EXT_USER_MOOD), JABBER_CAPS_USER_MOOD_NOTIFY }, { _T(JABBER_EXT_USER_TUNE), JABBER_CAPS_USER_TUNE_NOTIFY }, diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h index f8746309b8..29547c1ff5 100644 --- a/protocols/JabberG/src/jabber_caps.h +++ b/protocols/JabberG/src/jabber_caps.h @@ -106,6 +106,8 @@ typedef unsigned __int64 JabberCapsBits; #define JABBER_CAPS_SECUREIM ((JabberCapsBits)1<<28) #define JABBER_FEAT_MIROTR "http://miranda-ng.org/caps/mirotr" #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_FEAT_PRIVACY_LISTS "jabber:iq:privacy" #define JABBER_CAPS_PRIVACY_LISTS ((JabberCapsBits)1<<29) #define JABBER_FEAT_MESSAGE_RECEIPTS "urn:xmpp:receipts" @@ -150,12 +152,13 @@ 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_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) #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) #define JABBER_EXT_SECUREIM "secureim" #define JABBER_EXT_MIROTR "mirotr" +#define JABBER_EXT_NEWGPG "new_gpg" #define JABBER_EXT_COMMANDS "cmds" #define JABBER_EXT_USER_MOOD "mood" #define JABBER_EXT_USER_TUNE "tune" diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index a96c88618a..a714f16b08 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -528,6 +528,12 @@ void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, in mir_sntprintf(buf + offset, bufSize - offset, _T(" (MirOTR)")); } + if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_NEWGPG)) && !_tcsstr(buf, _T("(New_GPG)"))) + { + int offset = lstrlen(buf); + mir_sntprintf(buf + offset, bufSize - offset, _T(" (New_GPG)")); + } + if (resource->resourceName && !_tcsstr(buf, resource->resourceName)) { if (_tcsstr(buf, _T("Miranda IM")) || _tcsstr(buf, _T("Miranda NG")) || m_options.ShowForeignResourceInMirVer) diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index caa2f0929b..983f33392c 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; +extern int bSecureIM, bMirOTR, bNewGPG; void CJabberProto::SerialInit(void) { @@ -839,6 +839,12 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR _tcscat(szExtCaps, _T(JABBER_EXT_MIROTR)); } + if (bNewGPG) { + if (szExtCaps[0]) + _tcscat(szExtCaps, _T(" ")); + _tcscat(szExtCaps, _T(JABBER_EXT_NEWGPG)); + } + if (m_options.EnableRemoteControl) { if (szExtCaps[0]) _tcscat(szExtCaps, _T(" ")); -- cgit v1.2.3