summaryrefslogtreecommitdiff
path: root/plugins/MobileState/src/main.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-11-13 20:17:01 +0000
committerRobert Pösel <robyer@seznam.cz>2012-11-13 20:17:01 +0000
commit26f56c43370a09117821f818ac37bf9f550085ad (patch)
tree397e890126456a1dae70aa08ec270d9a0b8b3f2c /plugins/MobileState/src/main.cpp
parenta6bd36b9fa03b0d7c9e3cd4a5491ba7dae96c5a3 (diff)
MobileState: Rewrited detection and added more clients.
git-svn-id: http://svn.miranda-ng.org/main/trunk@2307 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MobileState/src/main.cpp')
-rw-r--r--plugins/MobileState/src/main.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp
index 0ea50726ad..f0c3bc77e9 100644
--- a/plugins/MobileState/src/main.cpp
+++ b/plugins/MobileState/src/main.cpp
@@ -18,6 +18,7 @@
*/
#include "commonheaders.h"
+#include "clients.h"
HINSTANCE g_hInst;
static HANDLE hHookModulesLoaded = NULL;
@@ -53,18 +54,19 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
bool hasMobileClient(HANDLE hContact, LPARAM lParam)
{
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- bool ret = false;
DBVARIANT dbv;
- if (!DBGetContactSettingTString(hContact, proto, "MirVer", &dbv))
- {
- if (_tcsstr(dbv.ptszVal, _T("Android")) || _tcsstr(dbv.ptszVal, _T("android")) || _tcsstr(dbv.ptszVal, _T("Mobile")) || _tcsstr(dbv.ptszVal, _T("mobile")))
- ret = true;
-
+ if (!DBGetContactSettingTString(hContact, proto, "MirVer", &dbv)) {
+ TCHAR *client = _tcslwr(NEWTSTR_ALLOCA(dbv.ptszVal));
DBFreeVariant(&dbv);
+
+ for (size_t i=0; i<(sizeof(clients) / sizeof(TCHAR*)); i++) {
+ if (_tcsstr(client, clients[i])) {
+ return true;
+ }
+ }
}
-
- return ret;
+ return false;
}
int ExtraIconsApply(WPARAM wParam, LPARAM lParam)