summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-03 12:46:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-03 12:46:52 +0000
commitd06e75fd7b0b11aa92fa075fdf30cec05d7a01f3 (patch)
treecfd050ae904cb9484d67f0cfcdcf57dccec5063c /protocols
parent158516fc55b5e38fd3d5cd67150cc85a5162f76b (diff)
additional fix for jabber
git-svn-id: http://svn.miranda-ng.org/main/trunk@1336 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/jabber.cpp8
-rw-r--r--protocols/JabberG/jabber.h1
-rw-r--r--protocols/JabberG/jabber_caps.cpp23
-rw-r--r--protocols/JabberG/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/jabber_util.cpp2
5 files changed, 11 insertions, 25 deletions
diff --git a/protocols/JabberG/jabber.cpp b/protocols/JabberG/jabber.cpp
index 446b7100c7..950ffb6edb 100644
--- a/protocols/JabberG/jabber.cpp
+++ b/protocols/JabberG/jabber.cpp
@@ -43,13 +43,13 @@ int hLangpack;
int g_cbCountries;
struct CountryListEntry* g_countries;
-static char szVersion[200] = "";
+char szCoreVersion[200];
PLUGININFOEX pluginInfo = {
sizeof( PLUGININFOEX ),
"Jabber Protocol",
__VERSION_DWORD,
- szVersion,
+ "Jabber protocol plugin for Miranda NG.",
"George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura",
"ghazan@miranda-im.org",
"(c) 2005-2012 George Hazan, Maxim Mluhov, Victor Pavlychko, Artem Shpynov, Michael Stepura",
@@ -223,10 +223,10 @@ extern "C" int __declspec( dllexport ) Load()
mir_getTMI( &tmi );
mir_getLP( &pluginInfo );
- CallService( MS_UTILS_GETCOUNTRYLIST, ( WPARAM )&g_cbCountries, ( LPARAM )&g_countries );
+ JCallService( MS_SYSTEM_GETVERSIONTEXT, SIZEOF(szCoreVersion), (LPARAM)szCoreVersion);
+ JCallService( MS_UTILS_GETCOUNTRYLIST, ( WPARAM )&g_cbCountries, ( LPARAM )&g_countries );
setlocale(LC_ALL, "");
- mir_snprintf( szVersion, sizeof( szVersion ), Translate("Jabber protocol plugin for Miranda NG."));
pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)hInst);
diff --git a/protocols/JabberG/jabber.h b/protocols/JabberG/jabber.h
index 363cf2fb7d..bd21b30dc8 100644
--- a/protocols/JabberG/jabber.h
+++ b/protocols/JabberG/jabber.h
@@ -575,6 +575,7 @@ extern BOOL (WINAPI *JabberIsThemeActive)();
extern HRESULT (WINAPI *JabberDrawThemeParentBackground)(HWND, HDC, RECT *);
extern const TCHAR xmlnsOwner[];
+extern char szCoreVersion[];
extern int g_cbCountries;
extern struct CountryListEntry* g_countries;
diff --git a/protocols/JabberG/jabber_caps.cpp b/protocols/JabberG/jabber_caps.cpp
index 176fd135ac..f38884dda3 100644
--- a/protocols/JabberG/jabber_caps.cpp
+++ b/protocols/JabberG/jabber_caps.cpp
@@ -549,7 +549,7 @@ CJabberClientCaps * CJabberClientCapsManager::FindClient( const TCHAR *szNode )
}
void CJabberClientCapsManager::AddDefaultCaps() {
- SetClientCaps( _T(JABBER_CAPS_MIRANDA_NODE), _T(__VERSION_STRING), JABBER_CAPS_MIRANDA_ALL );
+ SetClientCaps( _T(JABBER_CAPS_MIRANDA_NODE), _A2T(szCoreVersion), JABBER_CAPS_MIRANDA_ALL );
for ( int i = 0; g_JabberFeatCapPairsExt[i].szFeature; i++ )
SetClientCaps( _T(JABBER_CAPS_MIRANDA_NODE), g_JabberFeatCapPairsExt[i].szFeature, g_JabberFeatCapPairsExt[i].jcbCap );
@@ -680,11 +680,8 @@ BOOL CJabberClientCapsManager::HandleInfoRequest( HXML, CJabberIqInfo* pInfo, co
}
}
- DWORD dwCoreVersion = JCallService( MS_SYSTEM_GETVERSION, NULL, NULL );
- TCHAR szCoreVersion[ 256 ];
- mir_sntprintf( szCoreVersion, SIZEOF( szCoreVersion ), _T("%d.%d.%d.%d"),
- ( dwCoreVersion >> 24 ) & 0xFF, ( dwCoreVersion >> 16 ) & 0xFF,
- ( dwCoreVersion >> 8) & 0xFF, dwCoreVersion & 0xFF );
+ char szCoreVersion[ 256 ];
+ JCallService( MS_SYSTEM_GETVERSIONTEXT, SIZEOF(szCoreVersion), (LPARAM)szCoreVersion);
HXML form = query << XCHILDNS( _T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR( _T("type"), _T("result"));
form << XCHILD( _T("field")) << XATTR( _T("var"), _T("FORM_TYPE")) << XATTR( _T("type"), _T("hidden"))
@@ -695,19 +692,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest( HXML, CJabberIqInfo* pInfo, co
form << XCHILD( _T("field")) << XATTR( _T("var"), _T("os_version")) << XCHILD( _T("value"), os );
}
form << XCHILD( _T("field")) << XATTR( _T("var"), _T("software")) << XCHILD( _T("value"), _T("Miranda NG Jabber Protocol"));
- form << XCHILD( _T("field")) << XATTR( _T("var"), _T("software_version")) << XCHILD( _T("value"), _T(MIRANDA_VERSION_STRING));
- form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-version")) << XCHILD( _T("value"), szCoreVersion );
-
-#ifdef _DEBUG
- form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-jabber-is-debug")) << XCHILD( _T("value"), _T("1"));
-#endif
-
- char szMirandaVersion[100];
- if (!JCallService( MS_SYSTEM_GETVERSIONTEXT, sizeof( szMirandaVersion ), ( LPARAM )szMirandaVersion )) {
- _strlwr( szMirandaVersion );
- form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-is-unicode")) << XCHILD( _T("value"), strstr( szMirandaVersion, "unicode" ) ? _T("1") : _T("0"));
- form << XCHILD( _T("field")) << XATTR( _T("var"), _T("x-miranda-core-is-alpha")) << XCHILD( _T("value"), strstr( szMirandaVersion, "alpha" ) ? _T("1") : _T("0"));
- }
+ form << XCHILD( _T("field")) << XATTR( _T("var"), _T("software_version")) << XCHILD( _T("value"), _A2T(szCoreVersion));
}
ppro->m_ThreadInfo->send( iq );
diff --git a/protocols/JabberG/jabber_iq_handlers.cpp b/protocols/JabberG/jabber_iq_handlers.cpp
index cb2569b389..6846d0d477 100644
--- a/protocols/JabberG/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/jabber_iq_handlers.cpp
@@ -293,7 +293,7 @@ BOOL CJabberProto::OnIqRequestVersion( HXML, CJabberIqInfo* pInfo )
XmlNodeIq iq( _T("result"), pInfo );
HXML query = iq << XQUERY( _T(JABBER_FEAT_VERSION));
query << XCHILD( _T("name"), _T("Miranda NG Jabber"));
- query << XCHILD( _T("version"), _T(__VERSION_STRING));
+ query << XCHILD( _T("version"), _A2T(szCoreVersion));
if ( m_options.ShowOSVersion )
{
diff --git a/protocols/JabberG/jabber_util.cpp b/protocols/JabberG/jabber_util.cpp
index 463612c4e4..8f2eaed3c3 100644
--- a/protocols/JabberG/jabber_util.cpp
+++ b/protocols/JabberG/jabber_util.cpp
@@ -809,7 +809,7 @@ void CJabberProto::SendPresenceTo( int status, TCHAR* to, HXML extra, const TCHA
// XEP-0115:Entity Capabilities
HXML c = p << XCHILDNS( _T("c"), _T(JABBER_FEAT_ENTITY_CAPS)) << XATTR( _T("node"), _T(JABBER_CAPS_MIRANDA_NODE))
- << XATTR( _T("ver"), _T(__VERSION_STRING));
+ << XATTR( _T("ver"), _A2T(szCoreVersion));
TCHAR szExtCaps[ 512 ] = _T("");