diff options
Diffstat (limited to 'plugins/UserInfoEx/src/svc_email.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/svc_email.cpp | 81 |
1 files changed, 34 insertions, 47 deletions
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 27b7532551..5b886b72a3 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -2,7 +2,7 @@ UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -277,55 +277,42 @@ VOID SvcEMailApplyCListIcons() **/
VOID SvcEMailEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_EMAIL, bEnable);
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_EMAIL, bEnable);
+
+ if (bEnable) { // E-mail checkt
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "email"; //must be the same as the group name in extraicon
+ ico.description= "E-mail (uinfoex)";
+ ico.descIcon = ICO_BTN_EMAIL;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
+ ZeroMemory(&ico,sizeof(ico));
}
-
- if (bEnable) // E-mail checkt
- {
- // hook events
- if (hChangedHook == NULL)
- {
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- }
- if (hApplyIconHook == NULL)
- {
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
- }
-
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "email"; //must be the same as the group name in extraicon
- ico.description= "E-mail (uinfoex)";
- ico.descIcon = ICO_BTN_EMAIL;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- ZeroMemory(&ico,sizeof(ico));
- }
- }
- else // E-mail uncheckt
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else { // E-mail uncheckt
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcEMailApplyCListIcons();
}
+ SvcEMailApplyCListIcons();
}
/**
|