diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-02-06 10:33:05 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-02-06 10:33:05 +0000 |
commit | fe0585c1d7bf0a04a1106ee54a01aa3be2453cb3 (patch) | |
tree | 9904e4813c3485e33b6a3e72cfe816ad66333a9a /plugins/MobileState/src/main.cpp | |
parent | 582e8409f7da6e9e511b4568668e88e6657dcfcd (diff) |
MobileState: Tiny code cleanup; version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12020 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MobileState/src/main.cpp')
-rw-r--r-- | plugins/MobileState/src/main.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index 417343c3be..86c51de58b 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -54,15 +54,13 @@ bool hasMobileClient(MCONTACT hContact, LPARAM) {
char *proto = GetContactProto(hContact);
- DBVARIANT dbv;
- if (!db_get_ts(hContact, proto, "MirVer", &dbv)) {
- TCHAR *client = _tcslwr(NEWTSTR_ALLOCA(dbv.ptszVal));
- db_free(&dbv);
-
+ ptrT client(db_get_tsa(hContact, proto, "MirVer"));
+ if (client) {
for (size_t i = 0; i < SIZEOF(clients); i++)
if (_tcsstr(client, clients[i]))
return true;
}
+
return false;
}
@@ -80,15 +78,14 @@ int ExtraIconsApply(WPARAM wParam, LPARAM lParam) }
int onContactSettingChanged(WPARAM wParam, LPARAM lParam)
-{
- DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+{
char *proto = GetContactProto(wParam);
if (!proto)
return 0;
- if (!mir_strcmp(cws->szModule, proto))
- if (!mir_strcmp(cws->szSetting, "MirVer"))
- ExtraIconsApply(wParam, 1);
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if (!mir_strcmp(cws->szModule, proto) && !mir_strcmp(cws->szSetting, "MirVer"))
+ ExtraIconsApply(wParam, 1);
return 0;
}
|