summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_jabber.h4
-rw-r--r--plugins/ExternalAPI/m_jingle.h10
-rw-r--r--plugins/Jingle/Jingle.vcxproj3
-rw-r--r--plugins/Jingle/Jingle.vcxproj.filters8
-rw-r--r--plugins/Jingle/src/account.cpp62
-rw-r--r--plugins/Jingle/src/account.h18
-rw-r--r--plugins/Jingle/src/main.cpp8
-rw-r--r--plugins/Jingle/src/stdafx.h2
-rw-r--r--plugins/Jingle/src/version.h2
-rw-r--r--protocols/JabberG/src/jabber.cpp1
-rw-r--r--protocols/JabberG/src/jabber_api.cpp29
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp12
-rw-r--r--protocols/JabberG/src/jabber_caps.h17
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp7
-rw-r--r--protocols/JabberG/src/jabber_proto.h11
-rw-r--r--protocols/JabberG/src/jabber_voip.cpp7
-rw-r--r--protocols/JabberG/src/stdafx.h3
18 files changed, 138 insertions, 68 deletions
diff --git a/include/m_jabber.h b/include/m_jabber.h
index 7ebd9fe384..758dd6bc6c 100644
--- a/include/m_jabber.h
+++ b/include/m_jabber.h
@@ -31,8 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_xml.h>
-#define MS_JINGLE_SERVICE "Jabber/Jingle"
-
// Iq type flags
enum
{
@@ -140,7 +138,7 @@ struct IJabberInterface
// Entity capabilities support (see xep-0115)
// Registers feature so that it's displayed with proper description in other users' details. Call this function in your ME_SYSTEM_MODULESLOADED handler. Returns TRUE on success or FALSE on error.
- virtual int STDMETHODCALLTYPE RegisterFeature(LPCSTR szFeature, LPCSTR szDescription) = 0;
+ virtual int STDMETHODCALLTYPE RegisterFeature(LPCSTR szFeature, LPCSTR szDescription, LPCSTR ext = 0) = 0;
// Adds features to the list of features supported by the client. szFeatures is a list of features separated by \0 character and terminated with two \0 characters. You can call this function at any time. Returns TRUE on success or FALSE on error.
virtual int STDMETHODCALLTYPE AddFeatures(LPCSTR szFeatures) = 0;
diff --git a/plugins/ExternalAPI/m_jingle.h b/plugins/ExternalAPI/m_jingle.h
new file mode 100644
index 0000000000..1d8718fa58
--- /dev/null
+++ b/plugins/ExternalAPI/m_jingle.h
@@ -0,0 +1,10 @@
+#ifndef __m_jingle__
+#define __m_jingle__
+
+#define JABBER_FEAT_JINGLE "urn:xmpp:jingle:1"
+#define JABBER_FEAT_JINGLE_ICEUDP "urn:xmpp:jingle:transports:ice-udp:1"
+#define JABBER_FEAT_JINGLE_RTP "urn:xmpp:jingle:apps:rtp:1"
+#define JABBER_FEAT_JINGLE_DTLS "urn:xmpp:jingle:apps:dtls:0"
+#define JABBER_FEAT_JINGLE_RTPAUDIO "urn:xmpp:jingle:apps:rtp:audio"
+
+#endif // __m_jingle__
diff --git a/plugins/Jingle/Jingle.vcxproj b/plugins/Jingle/Jingle.vcxproj
index 1ad612cac7..0f061b8cfe 100644
--- a/plugins/Jingle/Jingle.vcxproj
+++ b/plugins/Jingle/Jingle.vcxproj
@@ -31,10 +31,13 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="src\account.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\stdafx.cxx">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
+ <ClInclude Include="..\ExternalAPI\m_jingle.h" />
+ <ClInclude Include="src\account.h" />
<ClInclude Include="src\stdafx.h" />
<ClInclude Include="src\version.h" />
</ItemGroup>
diff --git a/plugins/Jingle/Jingle.vcxproj.filters b/plugins/Jingle/Jingle.vcxproj.filters
index df6abcafef..947797218d 100644
--- a/plugins/Jingle/Jingle.vcxproj.filters
+++ b/plugins/Jingle/Jingle.vcxproj.filters
@@ -8,7 +8,7 @@
<ClCompile Include="src\stdafx.cxx">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\voip.cpp">
+ <ClCompile Include="src\account.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@@ -19,6 +19,12 @@
<ClInclude Include="src\version.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="src\account.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\ExternalAPI\m_jingle.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\Version.rc">
diff --git a/plugins/Jingle/src/account.cpp b/plugins/Jingle/src/account.cpp
new file mode 100644
index 0000000000..551f59db00
--- /dev/null
+++ b/plugins/Jingle/src/account.cpp
@@ -0,0 +1,62 @@
+/*
+Copyright (C) 2012-23 Miranda NG team (https://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "stdafx.h"
+
+static int OnModulesLoaded(WPARAM, LPARAM)
+{
+ for (auto &it : Accounts())
+ if (auto *pApi = getJabberApi(it->szModuleName)) {
+ auto *pAccount = new CJabberAccount(pApi);
+ g_arJabber.insert(pAccount);
+ pAccount->Init();
+ }
+
+ return 0;
+}
+
+static int OnAccountCreated(WPARAM reason, LPARAM param)
+{
+ if (reason == PRAC_ADDED) {
+ auto *pa = (PROTOACCOUNT *)param;
+ if (auto *pApi = getJabberApi(pa->szModuleName)) {
+ auto *pAccount = new CJabberAccount(pApi);
+ g_arJabber.insert(pAccount);
+ pAccount->Init();
+ }
+ }
+ return 0;
+}
+
+void CJabberAccount::InitHooks()
+{
+ HookEvent(ME_SYSTEM_MODULESLOADED, &OnModulesLoaded);
+ HookEvent(ME_PROTO_ACCLISTCHANGED, &OnAccountCreated);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CJabberAccount::Init()
+{
+ m_api->RegisterFeature(JABBER_FEAT_JINGLE, LPGEN("Supports Jingle"), "jingle");
+ m_api->RegisterFeature(JABBER_FEAT_JINGLE_ICEUDP, LPGEN("Jingle ICE-UDP Transport"));
+ m_api->RegisterFeature(JABBER_FEAT_JINGLE_RTP, LPGEN("Jingle RTP"));
+ m_api->RegisterFeature(JABBER_FEAT_JINGLE_DTLS, LPGEN("Jingle DTLS"));
+ m_api->RegisterFeature(JABBER_FEAT_JINGLE_RTPAUDIO, LPGEN("Jingle RTP Audio"));
+
+ m_api->AddFeatures(JABBER_FEAT_JINGLE "\0" JABBER_FEAT_JINGLE_ICEUDP "\0" JABBER_FEAT_JINGLE_RTP "\0" JABBER_FEAT_JINGLE_DTLS "\0" JABBER_FEAT_JINGLE_RTPAUDIO "\0\0");
+}
diff --git a/plugins/Jingle/src/account.h b/plugins/Jingle/src/account.h
new file mode 100644
index 0000000000..8302f8e3f2
--- /dev/null
+++ b/plugins/Jingle/src/account.h
@@ -0,0 +1,18 @@
+#ifndef _ACCOUNT_H
+#define _ACCOUNT_H
+
+struct CJabberAccount
+{
+ CJabberAccount(IJabberInterface *_1) :
+ m_api(_1)
+ {}
+
+ IJabberInterface *m_api;
+
+ void Init();
+ static void InitHooks();
+};
+
+extern OBJLIST<CJabberAccount> g_arJabber;
+
+#endif //_ACCOUNT_H \ No newline at end of file
diff --git a/plugins/Jingle/src/main.cpp b/plugins/Jingle/src/main.cpp
index 5936eb7fc9..016244ad29 100644
--- a/plugins/Jingle/src/main.cpp
+++ b/plugins/Jingle/src/main.cpp
@@ -2,6 +2,8 @@
CMPlugin g_plugin;
+OBJLIST<CJabberAccount> g_arJabber(1);
+
/////////////////////////////////////////////////////////////////////////////////////////
PLUGININFOEX pluginInfoEx = {
@@ -23,7 +25,7 @@ CMPlugin::CMPlugin() :
}
/////////////////////////////////////////////////////////////////////////////////////////
-// Load (hook ModulesLoaded)
+// Load
static INT_PTR FakeService(WPARAM, LPARAM)
{
@@ -40,6 +42,8 @@ int CMPlugin::Load()
{
SetEnvironmentVariableW(L"GST_PLUGIN_PATH", VARSW(L"%miranda_path%\\Libs\\gst_plugins"));
- CreateServiceFunction(MS_JINGLE_SERVICE, &FakeService);
+ CreateServiceFunction("JINGLE/SERVICE", &FakeService);
+
+ CJabberAccount::InitHooks();
return 0;
}
diff --git a/plugins/Jingle/src/stdafx.h b/plugins/Jingle/src/stdafx.h
index ace5347f03..ff0b86c4b9 100644
--- a/plugins/Jingle/src/stdafx.h
+++ b/plugins/Jingle/src/stdafx.h
@@ -21,10 +21,12 @@
#include <newpluginapi.h>
#include <m_jabber.h>
+#include <m_jingle.h>
#include <m_langpack.h>
#include <m_voice.h>
#include <m_voiceservice.h>
+#include "account.h"
#include "resource.h"
#include "version.h"
diff --git a/plugins/Jingle/src/version.h b/plugins/Jingle/src/version.h
index 4966be0dde..4e88b19d46 100644
--- a/plugins/Jingle/src/version.h
+++ b/plugins/Jingle/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 84cbfe2c4e..1c13d97a87 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -95,7 +95,6 @@ static int OnLoadModule(WPARAM, LPARAM)
{
g_plugin.bMessageState = ServiceExists(MS_MESSAGESTATE_UPDATE);
g_plugin.bSecureIM = ServiceExists("SecureIM/IsContactSecured") != 0;
- g_plugin.bJingle = ServiceExists(MS_JINGLE_SERVICE);
g_plugin.bMirOTR = GetModuleHandle(L"mirotr.dll") != nullptr;
g_plugin.bNewGPG = GetModuleHandle(L"new_gpg.dll") != nullptr;
return 0;
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp
index 70c94ead16..ef2b285f70 100644
--- a/protocols/JabberG/src/jabber_api.cpp
+++ b/protocols/JabberG/src/jabber_api.cpp
@@ -190,18 +190,18 @@ JabberFeatCapPairDynamic *CJabberProto::FindFeature(const char *szFeature)
return nullptr;
}
-int CJabberProto::RegisterFeature(const char *szFeature, const char *szDescription)
+int CJabberProto::RegisterFeature(const char *pszFeature, const char *pszDescription, const char *pszExt)
{
- if (!szFeature)
+ if (!pszFeature)
return false;
// check for this feature in core features, and return false if it's present, to prevent re-registering a core feature
for (int i = 0; i < g_cJabberFeatCapPairs; i++)
- if (!mir_strcmp(g_JabberFeatCapPairs[i].szFeature, szFeature))
+ if (!mir_strcmp(g_JabberFeatCapPairs[i].szFeature, pszFeature))
return false;
mir_cslock lck(m_csLists);
- JabberFeatCapPairDynamic *fcp = FindFeature(szFeature);
+ JabberFeatCapPairDynamic *fcp = FindFeature(pszFeature);
if (!fcp) { // if the feature is not registered yet, allocate new bit for it
JabberCapsBits jcb = JABBER_CAPS_OTHER_SPECIAL; // set all bits not included in g_JabberFeatCapPairs
@@ -220,26 +220,17 @@ int CJabberProto::RegisterFeature(const char *szFeature, const char *szDescripti
if (!jcb)
return false;
- // remove unnecessary symbols from szFeature to make the string shorter, and use it as szExt
- LPSTR szExt = mir_strdup(szFeature);
- LPSTR pSrc, pDst;
- for (pSrc = szExt, pDst = szExt; *pSrc; pSrc++)
- if (wcschr(L"bcdfghjklmnpqrstvwxz0123456789", *pSrc))
- *pDst++ = *pSrc;
- *pDst = 0;
- g_clientCapsManager.SetClientCaps(JABBER_CAPS_MIRANDA_NODE, m_szFeaturesCrc, szExt, jcb);
+ g_clientCapsManager.SetClientCaps(JABBER_CAPS_MIRANDA_NODE, m_szFeaturesCrc, "", jcb);
fcp = new JabberFeatCapPairDynamic();
- fcp->szExt = szExt; // will be deallocated along with other values of JabberFeatCapPairDynamic in CJabberProto destructor
- fcp->szFeature = mir_strdup(szFeature);
- fcp->szDescription = szDescription ? mir_strdup(szDescription) : nullptr;
+ fcp->szExt = mir_strdup(pszExt);
+ fcp->szFeature = mir_strdup(pszFeature);
+ fcp->szDescription = mir_strdup(pszDescription);
fcp->jcbCap = jcb;
m_lstJabberFeatCapPairsDynamic.insert(fcp);
}
- else if (szDescription) { // update description
- if (fcp->szDescription)
- mir_free(fcp->szDescription);
- fcp->szDescription = mir_strdup(szDescription);
+ else if (pszDescription) { // update description
+ fcp->szDescription = mir_strdup(pszDescription);
}
return true;
}
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 57d4cec6b1..852ba4e935 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -74,15 +74,10 @@ const JabberFeatCapPair g_JabberFeatCapPairs[] =
{ JABBER_FEAT_USER_ACTIVITY, JABBER_CAPS_USER_ACTIVITY, LPGEN("Can report information about user activity") },
{ JABBER_FEAT_USER_ACTIVITY_NOTIFY, JABBER_CAPS_USER_ACTIVITY_NOTIFY, LPGEN("Receives information about user activity") },
{ JABBER_FEAT_MIRANDA_NOTES, JABBER_CAPS_MIRANDA_NOTES, LPGEN("Supports Miranda NG notes extension") },
- { JABBER_FEAT_JINGLE, JABBER_CAPS_JINGLE, LPGEN("Supports Jingle") },
{ JABBER_FEAT_ROSTER_EXCHANGE, JABBER_CAPS_ROSTER_EXCHANGE, LPGEN("Supports Roster Exchange") },
{ JABBER_FEAT_DIRECT_MUC_INVITE, JABBER_CAPS_DIRECT_MUC_INVITE, LPGEN("Supports direct chat invitations (XEP-0249)") },
{ JABBER_FEAT_OMEMO_DEVICELIST_NOTIFY, JABBER_CAPS_OMEMO_DEVICELIST_NOTIFY, LPGEN("Receives information about OMEMO devices") },
{ JABBER_FEAT_CARBONS, JABBER_CAPS_CARBONS, LPGEN("Supports message carbons (XEP-0280)")},
- { JABBER_FEAT_JINGLE_ICEUDP, JABBER_CAPS_JINGLE_ICEUDP, LPGEN("Jingle ICE-UDP Transport") },
- { JABBER_FEAT_JINGLE_RTP, JABBER_CAPS_JINGLE_RTP, LPGEN("Jingle RTP") },
- { JABBER_FEAT_JINGLE_DTLS, JABBER_CAPS_JINGLE_DTLS, LPGEN("Jingle DTLS") },
- { JABBER_FEAT_JINGLE_RTPAUDIO, JABBER_CAPS_JINGLE_RTPAUDIO, LPGEN("Jingle RTP Audio") },
};
const int g_cJabberFeatCapPairs = _countof(g_JabberFeatCapPairs);
@@ -94,7 +89,6 @@ const JabberFeatCapPairExt g_JabberFeatCapPairsExt[] =
{ JABBER_EXT_NEWGPG, JABBER_CAPS_NEWGPG, "/ExportGPGKeys" },
{ JABBER_EXT_OMEMO, JABBER_CAPS_OMEMO, },
{ JABBER_EXT_NUDGE, JABBER_CAPS_ATTENTION, "NUDGE/Send" },
- { JABBER_EXT_JINGLE, JABBER_CAPS_JINGLE, MS_JINGLE_SERVICE },
{ JABBER_EXT_COMMANDS, JABBER_CAPS_COMMANDS },
{ JABBER_EXT_USER_ACTIVITY, JABBER_CAPS_USER_ACTIVITY_NOTIFY },
{ JABBER_EXT_USER_MOOD, JABBER_CAPS_USER_MOOD_NOTIFY },
@@ -351,8 +345,6 @@ JabberCapsBits CJabberProto::GetOwnCaps(bool IncludeDynamic)
jcb |= JABBER_CAPS_OMEMO_DEVICELIST_NOTIFY;
if (!m_bMsgAck)
jcb &= ~(JABBER_CAPS_CHAT_MARKERS | JABBER_CAPS_MESSAGE_RECEIPTS);
- if (hasJingle())
- jcb |= JABBER_CAPS_JINGLE | JABBER_CAPS_JINGLE_ICEUDP | JABBER_CAPS_JINGLE_RTP | JABBER_CAPS_JINGLE_DTLS | JABBER_CAPS_JINGLE_RTPAUDIO;
return jcb;
}
@@ -417,8 +409,8 @@ void CJabberProto::UpdateFeatHash()
/////////////////////////////////////////////////////////////////////////////////////////
// CJabberClientPartialCaps class
-CJabberClientPartialCaps::CJabberClientPartialCaps(CJabberClientCaps *pParent, const char *szHash, const char *szVer)
- : m_parent(pParent),
+CJabberClientPartialCaps::CJabberClientPartialCaps(CJabberClientCaps *pParent, const char *szHash, const char *szVer) :
+ m_parent(pParent),
m_szHash(mir_strdup(szHash)),
m_szSoftVer(mir_strdup(szVer))
{
diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h
index e8ceccf4a0..66d0ecf2b8 100644
--- a/protocols/JabberG/src/jabber_caps.h
+++ b/protocols/JabberG/src/jabber_caps.h
@@ -165,9 +165,6 @@ typedef unsigned __int64 JabberCapsBits;
#define JABBER_FEAT_MIRANDA_NOTES "http://miranda-ng.org/storage#notes"
#define JABBER_CAPS_MIRANDA_NOTES ((JabberCapsBits)1<<39)
-#define JABBER_FEAT_JINGLE "urn:xmpp:jingle:1"
-#define JABBER_CAPS_JINGLE ((JabberCapsBits)1<<40)
-
#define JABBER_FEAT_ROSTER_EXCHANGE "http://jabber.org/protocol/rosterx"
#define JABBER_CAPS_ROSTER_EXCHANGE ((JabberCapsBits)1<<41)
@@ -195,15 +192,6 @@ typedef unsigned __int64 JabberCapsBits;
#define JABBER_FEAT_BITS "urn:xmpp:bob"
#define JABBER_CAPS_BITS ((JabberCapsBits)1<<50)
-#define JABBER_FEAT_JINGLE_ICEUDP "urn:xmpp:jingle:transports:ice-udp:1"
-#define JABBER_CAPS_JINGLE_ICEUDP ((JabberCapsBits)1<<51)
-#define JABBER_FEAT_JINGLE_RTP "urn:xmpp:jingle:apps:rtp:1"
-#define JABBER_CAPS_JINGLE_RTP ((JabberCapsBits)1<<52)
-#define JABBER_FEAT_JINGLE_DTLS "urn:xmpp:jingle:apps:dtls:0"
-#define JABBER_CAPS_JINGLE_DTLS ((JabberCapsBits)1<<53)
-#define JABBER_FEAT_JINGLE_RTPAUDIO "urn:xmpp:jingle:apps:rtp:audio"
-#define JABBER_CAPS_JINGLE_RTPAUDIO ((JabberCapsBits)1<<54)
-
#define JABBER_FEAT_ARCHIVE "urn:xmpp:archive"
#define JABBER_FEAT_BIND "urn:ietf:params:xml:ns:xmpp-bind"
#define JABBER_FEAT_CAPTCHA "urn:xmpp:captcha"
@@ -237,7 +225,6 @@ typedef unsigned __int64 JabberCapsBits;
#define JABBER_EXT_SECUREIM "secureim"
#define JABBER_EXT_MIROTR "mirotr"
-#define JABBER_EXT_JINGLE "jingle"
#define JABBER_EXT_NEWGPG "new_gpg"
#define JABBER_EXT_OMEMO "omemo"
#define JABBER_EXT_NUDGE "nudge"
@@ -381,10 +368,8 @@ struct JabberFeatCapPairExt
struct JabberFeatCapPairDynamic
{
- char *szExt;
- char *szFeature;
+ ptrA szFeature, szDescription, szExt;
JabberCapsBits jcbCap;
- char *szDescription;
};
extern const int g_cJabberFeatCapPairs;
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index e5c570e589..b0bc6d6342 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -707,7 +707,7 @@ public:
m_options.AddOption(LPGENW("Messaging"), LPGENW("Enable carbon copies (XEP-0280)"), m_proto->m_bEnableCarbons);
if (mir_strlen(ptrA(m_proto->getStringA("HttpUpload"))))
m_options.AddOption(LPGENW("Messaging"), LPGENW("Enable HTTP File Upload (XEP-0363)"), m_proto->m_bUseHttpUpload);
- if (g_plugin.bJingle)
+ if (m_proto->hasJingle())
m_options.AddOption(LPGENW("Messaging"), LPGENW("Enable VOIP (experimental)"), m_proto->m_bEnableVOIP);
m_options.AddOption(LPGENW("Server options"), LPGENW("Use Stream Management (XEP-0198) if possible (experimental)"), m_proto->m_bEnableStreamMgmt);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 99a1ff1688..b094f85590 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -283,12 +283,7 @@ CJabberProto::~CJabberProto()
for (auto &it : m_lstTransports)
mir_free(it);
- for (auto &it : m_lstJabberFeatCapPairsDynamic) {
- mir_free(it->szExt);
- mir_free(it->szFeature);
- mir_free(it->szDescription);
- delete it;
- }
+ m_lstJabberFeatCapPairsDynamic.destroy();
}
////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 4d8291177d..b5a882df24 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -307,9 +307,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
mir_cs m_csLists;
BOOL m_bListInitialised;
- LIST<JabberFeatCapPairDynamic> m_lstJabberFeatCapPairsDynamic; // list of features registered through IJabberNetInterface::RegisterFeature()
- JabberCapsBits m_uEnabledFeatCapsDynamic;
-
+ // menus
HGENMENU m_hMenuRoot;
HGENMENU m_hMenuChangePassword;
HGENMENU m_hMenuGroupchat;
@@ -424,6 +422,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, char* buffer, int datalen);
//---- jabber_caps.cpp ---------------------------------------------------------------
+ OBJLIST<JabberFeatCapPairDynamic> m_lstJabberFeatCapPairsDynamic; // list of features registered through IJabberNetInterface::RegisterFeature()
+ JabberCapsBits m_uEnabledFeatCapsDynamic;
CMStringA m_szFeaturesCrc;
@@ -724,7 +724,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
bool OmemoHandleMessage(const TiXmlElement *node, const char *jid, time_t msgTime, bool isCarbon);
void OmemoPutMessageToOutgoingQueue(MCONTACT hContact, const char *pszSrc);
- void OmemoPutMessageToIncommingQueue(const TiXmlElement *node, const char *jid, time_t msgTime);
void OmemoHandleMessageQueue();
bool OmemoHandleDeviceList(const char *from, const TiXmlElement *node);
void OmemoInitDevice();
@@ -920,7 +919,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
struct _GstElement *m_webrtc1 = NULL;
__forceinline bool hasJingle()
- { return g_plugin.bJingle && m_bEnableVOIP;
+ { return FindFeature(JABBER_FEAT_JINGLE) != 0 && m_bEnableVOIP;
}
//---- jabber_xml.c ------------------------------------------------------------------
@@ -990,7 +989,7 @@ public:
HJHANDLER STDMETHODCALLTYPE AddSendHandler(JABBER_HANDLER_FUNC Func, void *pUserData, int iPriority) override;
int STDMETHODCALLTYPE RemoveHandler(HJHANDLER hHandler) override;
- int STDMETHODCALLTYPE RegisterFeature(const char *szFeature, const char *szDescription) override;
+ int STDMETHODCALLTYPE RegisterFeature(const char *szFeature, const char *szDescription, const char *ext = 0) override;
int STDMETHODCALLTYPE AddFeatures(const char *szFeatures) override; // Adds features to the list of features returned by the client.
int STDMETHODCALLTYPE RemoveFeatures(const char *szFeatures) override; // Removes features from the list of features returned by the client.
char* STDMETHODCALLTYPE GetResourceFeatures(const char *jid) override; // Returns all features supported by JID in format "feature1\0feature2\0...\0featureN\0\0". You must free returned string using mir_free().
diff --git a/protocols/JabberG/src/jabber_voip.cpp b/protocols/JabberG/src/jabber_voip.cpp
index 85d8ad3f12..9c8cb589d9 100644
--- a/protocols/JabberG/src/jabber_voip.cpp
+++ b/protocols/JabberG/src/jabber_voip.cpp
@@ -490,7 +490,12 @@ bool CJabberProto::VOIPCallIinitiate(MCONTACT hContact)
auto r = ListGetBestResource(jid);
if (r) {
- if (!(r->m_pCaps->GetCaps() & JABBER_CAPS_JINGLE)) {
+ bool bFound = false;
+ if (auto *pFeature = FindFeature(JABBER_FEAT_JINGLE))
+ if (!(r->m_pCaps->GetCaps() & pFeature->jcbCap))
+ bFound = true;
+
+ if (!bFound) {
MsgPopup(hContact, TranslateT("Client's program does not support voice calls"), TranslateT("Error"));
return false;
}
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index 384f300be8..82b719af32 100644
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -70,6 +70,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_hotkeys.h>
#include <m_icolib.h>
#include <m_idle.h>
+#include <m_jingle.h>
#include <m_json.h>
#include <m_langpack.h>
#include <m_message.h>
@@ -121,7 +122,7 @@ struct CJabberProto;
struct CMPlugin : public ACCPROTOPLUGIN<CJabberProto>
{
- bool bMessageState = false, bSecureIM = false, bMirOTR = false, bNewGPG = false, bPlatform = false, bJingle = false;
+ bool bMessageState = false, bSecureIM = false, bMirOTR = false, bNewGPG = false, bPlatform = false;
char szRandom[17];
CMPlugin();