summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-14 16:18:15 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-14 16:18:15 +0300
commitcc9adee406ad0434e470dfc11ed3896c6be32073 (patch)
tree22643d0888e35c56fad6df9071bc6ec5c11235dd
parent444f8615792ebdfeb8278a13a2adf27c66783013 (diff)
Jabber: fix for retrieving QIP versions
-rw-r--r--plugins/FingerprintNG/src/masks.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp31
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.h1
3 files changed, 20 insertions, 16 deletions
diff --git a/plugins/FingerprintNG/src/masks.cpp b/plugins/FingerprintNG/src/masks.cpp
index 51d54530f1..7ed05f1eea 100644
--- a/plugins/FingerprintNG/src/masks.cpp
+++ b/plugins/FingerprintNG/src/masks.cpp
@@ -153,8 +153,8 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_QIP_Symbian", L"*QIP*Symbian*", L"QIP Mobile Symbian", IDI_QIP_SYMBIAN, MULTI_CASE, TRUE },
{ "client_QIP_Java", L"*QIP*Java*", L"QIP Mobile Java", IDI_QIP_JAVA, MULTI_CASE, TRUE },
{ "client_QIP_PDA", L"|QIP *PDA*|*pda.qip.ru*|*QIP Mobile*", L"QIP Mobile", IDI_QIP_PDA, MULTI_CASE, TRUE },
- { "client_QIP_2012", L"|QIP 2012*|http://qip.ru/caps*", L"QIP 2012", IDI_QIP_2012, MULTI_CASE, TRUE },
- { "client_QIP_2010", L"|QIP 2010*|http://2010.qip.ru*", L"QIP 2010", IDI_QIP_2010, MULTI_CASE, TRUE },
+ { "client_QIP_2012", L"QIP 2012*", L"QIP 2012", IDI_QIP_2012, MULTI_CASE, TRUE },
+ { "client_QIP_2010", L"QIP 2010*", L"QIP 2010", IDI_QIP_2010, MULTI_CASE, TRUE },
{ "client_QIP_Infium", L"|QIP Infium*|http://*qip*", L"QIP Infium", IDI_QIP_INFIUM, MULTI_CASE, TRUE },
{ "client_qutIM", L"*qutIM*", L"qutIM", IDI_QUTIM, MULTI_CASE },
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 0f4eae9e81..2c89d52b94 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -250,14 +250,25 @@ struct
}
static sttCapsNodeToName_Map[] =
{
- { L"http://miranda-im.org", L"Miranda IM Jabber" },
- { L"http://miranda-ng.org", L"Miranda NG Jabber" },
- { L"http://www.google.com", L"GTalk" },
+ { L"http://miranda-im.org", L"Miranda IM Jabber" },
+ { L"http://miranda-ng.org", L"Miranda NG Jabber" },
+ { L"http://www.google.com", L"GTalk" },
{ L"http://mail.google.com", L"GMail" },
- { L"http://talk.google.com/xmpp/bot", L"GTalk Bot" },
{ L"http://www.android.com", L"Android" },
+ { L"http://qip.ru", L"QIP 2012" },
+ { L"http://2010.qip.ru", L"QIP 2010"}
};
+const wchar_t* CJabberProto::GetSoftName(const wchar_t *wszName)
+{
+ // search through known software list
+ for (int i = 0; i < _countof(sttCapsNodeToName_Map); i++)
+ if (wcsstr(wszName, sttCapsNodeToName_Map[i].node))
+ return sttCapsNodeToName_Map[i].name;
+
+ return nullptr;
+}
+
void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
{
MCONTACT hContact = HContactFromJID(item->jid);
@@ -293,17 +304,9 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMStringW &res)
CJabberClientPartialCaps *pCaps = resource->m_pCaps;
debugLogW(L"JabberUpdateMirVer: for rc %s: %s#%s", resource->m_tszResourceName, pCaps->GetNode(), pCaps->GetHash());
- // search through known software list
- int i;
- for (i = 0; i < _countof(sttCapsNodeToName_Map); i++)
- if (wcsstr(pCaps->GetNode(), sttCapsNodeToName_Map[i].node)) {
- res.Format(L"%s %s", sttCapsNodeToName_Map[i].name, pCaps->GetSoftVer());
- break;
- }
-
// unknown software
- if (i == _countof(sttCapsNodeToName_Map))
- res.Format(L"%s %s", pCaps->GetSoft(), pCaps->GetSoftVer());
+ const wchar_t *szDefaultName = GetSoftName(pCaps->GetNode());
+ res.Format(L"%s %s", (szDefaultName == nullptr) ? pCaps->GetSoft() : szDefaultName, pCaps->GetSoftVer());
}
// attach additional info for fingerprint plguin
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index aa2218411d..04b8118278 100755
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -603,6 +603,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void InitPopups(void);
void MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle);
CMStringW ExtractImage(HXML node);
+ const wchar_t* GetSoftName(const wchar_t *wszName);
//---- jabber_opt.cpp ----------------------------------------------------------------
INT_PTR __cdecl OnMenuHandleRosterControl(WPARAM wParam, LPARAM lParam);