summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-10 21:36:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-10 21:36:54 +0000
commit9c2e0c8b025c98cbff2975e6dd9c86e03cd04244 (patch)
treebd95b8ef2753ef3f2b3701bfe350eb7682794319 /plugins/UserInfoEx
parentf22d8982b41614d703b0db98264e01ef7049a4a0 (diff)
code cleaning for ME_DB_CONTACT_SETTINGCHANGED in plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@2283 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp60
-rw-r--r--plugins/UserInfoEx/src/svc_gender.cpp3
-rw-r--r--plugins/UserInfoEx/src/svc_homepage.cpp3
-rw-r--r--plugins/UserInfoEx/src/svc_phone.cpp3
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp7
5 files changed, 34 insertions, 42 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index e1f4b700f0..c864e0bca8 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -284,34 +284,34 @@ static int OnCListApplyIcons(WPARAM wParam,LPARAM lParam)
static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
- if ((HANDLE)wParam!=NULL)return 0;
- if (!lstrcmpA(dbcws->szModule, "ExtraIcons") &&
- !lstrcmpA(dbcws->szSetting,"Slot_Flags")) {
- BOOL bEnable;
- switch (dbcws->value.type) {
- case DBVT_BYTE:
- bEnable = dbcws->value.bVal != (BYTE)-1;
- break;
- case DBVT_WORD:
- bEnable = dbcws->value.wVal != (WORD)-1;
- break;
- case DBVT_DWORD:
- bEnable = dbcws->value.dVal != (DWORD)-1;
- break;
- default:
- bEnable = -1;
- break;
- }
- if(bEnable == -1) {
- return 0;
- }
- else if(bEnable && !hApplyIconHook) {
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
- }
- else if (!bEnable && hApplyIconHook) {
- UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
- }
- CallFunctionBuffered(UpdateExtraImages,(LPARAM)bEnable,FALSE,EXTRAIMAGE_REFRESHDELAY);
+ if ((HANDLE)wParam != NULL)
+ return 0;
+
+ if (!lstrcmpA(dbcws->szModule, "ExtraIcons") && !lstrcmpA(dbcws->szSetting,"Slot_Flags")) {
+ BOOL bEnable;
+ switch (dbcws->value.type) {
+ case DBVT_BYTE:
+ bEnable = dbcws->value.bVal != (BYTE)-1;
+ break;
+ case DBVT_WORD:
+ bEnable = dbcws->value.wVal != (WORD)-1;
+ break;
+ case DBVT_DWORD:
+ bEnable = dbcws->value.dVal != (DWORD)-1;
+ break;
+ default:
+ bEnable = -1;
+ break;
+ }
+ if(bEnable == -1)
+ return 0;
+
+ if(bEnable && !hApplyIconHook)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+ else if (!bEnable && hApplyIconHook)
+ UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
+
+ CallFunctionBuffered(UpdateExtraImages,(LPARAM)bEnable,FALSE,EXTRAIMAGE_REFRESHDELAY);
}
return 0;
}
@@ -347,10 +347,10 @@ VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB)
//init hooks
if (!hApplyIconHook)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
if (!hSettingChangedHook)
- hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
+ hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
}
}
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp
index 6ac632e6af..68d6f5b8ec 100644
--- a/plugins/UserInfoEx/src/svc_gender.cpp
+++ b/plugins/UserInfoEx/src/svc_gender.cpp
@@ -108,9 +108,8 @@ static INT OnCListApplyIcons(HANDLE hContact, LPARAM)
static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && pdbcws && (pdbcws->value.type <= DBVT_BYTE) && !mir_stricmp(pdbcws->szSetting, SET_CONTACT_GENDER))
- {
OnCListApplyIcons(hContact, 0);
- }
+
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp
index b6a6f9ee46..8c3cf5ff3d 100644
--- a/plugins/UserInfoEx/src/svc_homepage.cpp
+++ b/plugins/UserInfoEx/src/svc_homepage.cpp
@@ -132,9 +132,8 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw
((pdbcws->value.type & DBVTF_VARIABLELENGTH) || (pdbcws->value.type == DBVT_DELETED)) &&
(!strncmp(pdbcws->szSetting, SET_CONTACT_HOMEPAGE, 8) ||
!strncmp(pdbcws->szSetting, SET_CONTACT_COMPANY_HOMEPAGE, 15)))
- {
OnCListApplyIcons(hContact, 0);
- }
+
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp
index 5d4e2f13d1..941003716b 100644
--- a/plugins/UserInfoEx/src/svc_phone.cpp
+++ b/plugins/UserInfoEx/src/svc_phone.cpp
@@ -134,9 +134,8 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw
!strcmp(pdbcws->szSetting, SET_CONTACT_COMPANY_PHONE) ||
!strcmp(pdbcws->szSetting, SET_CONTACT_COMPANY_CELLULAR) ||
!strncmp(pdbcws->szSetting, "MyPhone0", 8)))
- {
OnCListApplyIcons(hContact, 0);
- }
+
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index 3781145d11..91f19eb804 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -766,18 +766,13 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw
// check metacontact instead of subcontact
if (hMeta)
- {
hContact = hMeta;
- }
+
now.GetLocalTime();
if (!strcmp(pdbcws->szModule, SvcReminderGetMyBirthdayModule()))
- {
CheckContact(hContact, now, evt, FALSE, &LastAnswer);
- }
else
- {
CheckContact(hContact, now, evt, FALSE, 0);
- }
}
return 0;
}