summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/JabberG/src/jabber.cpp3
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp2
-rw-r--r--protocols/JabberG/src/jabber_caps.h5
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp6
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp1
-rw-r--r--protocols/JabberG/src/jabber_util.cpp8
7 files changed, 21 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 89db47c1f0..5d96216773 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;
+int bSecureIM, bMirOTR;
/////////////////////////////////////////////////////////////////////////////
// Protocol instances
@@ -150,6 +150,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
hModulesLoadedTB = HookEvent(ME_TTB_MODULELOADED, g_OnToolbarInit);
bSecureIM = (ServiceExists("SecureIM/IsContactSecured"));
+ bMirOTR = (int)GetModuleHandle(_T("mirotr.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 5b24a7c184..57ac7d77da 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -57,6 +57,7 @@ const JabberFeatCapPair g_JabberFeatCapPairs[] = {
{ _T(JABBER_FEAT_USER_MOOD_NOTIFY), JABBER_CAPS_USER_MOOD_NOTIFY, _T("Receives information about user moods") },
{ _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_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") },
@@ -77,6 +78,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_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 ac9b1f28ef..f8746309b8 100644
--- a/protocols/JabberG/src/jabber_caps.h
+++ b/protocols/JabberG/src/jabber_caps.h
@@ -104,6 +104,8 @@ typedef unsigned __int64 JabberCapsBits;
#define JABBER_CAPS_PUBSUB ((JabberCapsBits)1<<27)
#define JABBER_FEAT_SECUREIM "http://miranda-ng.org/caps/secureim"
#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_PRIVACY_LISTS "jabber:iq:privacy"
#define JABBER_CAPS_PRIVACY_LISTS ((JabberCapsBits)1<<29)
#define JABBER_FEAT_MESSAGE_RECEIPTS "urn:xmpp:receipts"
@@ -148,11 +150,12 @@ 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_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_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_COMMANDS "cmds"
#define JABBER_EXT_USER_MOOD "mood"
#define JABBER_EXT_USER_TUNE "tune"
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index da82862354..8458d833b6 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_iq.h"
#include "jabber_rc.h"
-extern int bSecureIM;
-
#ifndef VER_SUITE_WH_SERVER
#define VER_SUITE_WH_SERVER 0x00008000
#endif
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index b9ee0af8ce..a96c88618a 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -522,6 +522,12 @@ void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, in
mir_sntprintf(buf + offset, bufSize - offset, _T(" (SecureIM)"));
}
+ if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_MIROTR)) && !_tcsstr(buf, _T("(MirOTR)")))
+ {
+ int offset = lstrlen(buf);
+ mir_sntprintf(buf + offset, bufSize - offset, _T(" (MirOTR)"));
+ }
+
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_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 47ecb1366e..7ab9d74d72 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -47,7 +47,6 @@ int iqIdRegSetReg;
#define JCPF_OUT 0x02UL
#define JCPF_ERROR 0x04UL
-//extern int bSecureIM;
static VOID CALLBACK JabberDummyApcFunc(DWORD_PTR)
{
return;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index a5b41add1e..caa2f0929b 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;
+extern int bSecureIM, bMirOTR;
void CJabberProto::SerialInit(void)
{
@@ -833,6 +833,12 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR
_tcscat(szExtCaps, _T(JABBER_EXT_SECUREIM));
}
+ if (bMirOTR) {
+ if (szExtCaps[0])
+ _tcscat(szExtCaps, _T(" "));
+ _tcscat(szExtCaps, _T(JABBER_EXT_MIROTR));
+ }
+
if (m_options.EnableRemoteControl) {
if (szExtCaps[0])
_tcscat(szExtCaps, _T(" "));