diff options
author | George Hazan <ghazan@miranda.im> | 2019-09-26 22:15:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-09-26 22:15:57 +0300 |
commit | 15c49e3fc4cf033fffbf79e9f68a0405d5a95d14 (patch) | |
tree | 3ba342e3e8645156102d3c5f3f9a1b5dafe4c22c /plugins/MenuItemEx/src | |
parent | d095047014348c9e8dd72a72dc59b2abd22bbf9c (diff) |
Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it
Diffstat (limited to 'plugins/MenuItemEx/src')
-rw-r--r-- | plugins/MenuItemEx/src/main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 5a1c87ab99..a8c8a6f3c5 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -377,7 +377,7 @@ static INT_PTR onSetVis(WPARAM wparam, LPARAM) static INT_PTR onHide(WPARAM wparam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wparam;
- db_set_b(hContact, "CList", "Hidden", (BYTE)!db_get_b(hContact, "CList", "Hidden", 0));
+ Clist_HideContact(hContact, !Clist_IsHidden(hContact));
return 0;
}
@@ -643,7 +643,7 @@ static int isIgnored(MCONTACT hContact, int type) static INT_PTR onIgnore(WPARAM wparam, LPARAM lparam)
{
if (g_plugin.getByte("ignorehide", 0) && (lparam == IGNOREEVENT_ALL))
- db_set_b((MCONTACT)wparam, "CList", "Hidden", (isIgnored((MCONTACT)wparam, lparam) ? (byte)0 : (byte)1));
+ Clist_HideContact(wparam, !isIgnored((MCONTACT)wparam, lparam));
CallService(isIgnored((MCONTACT)wparam, lparam) ? MS_IGNORE_UNIGNORE : MS_IGNORE_IGNORE, wparam, lparam);
return 0;
@@ -693,8 +693,7 @@ static int BuildMenu(WPARAM wparam, LPARAM) bEnabled = bShowAll || (flags & VF_HFL);
Menu_ShowItem(hmenuHide, bEnabled);
if (bEnabled) {
- BYTE bHidden = db_get_b(hContact, "CList", "Hidden", 0);
- if (bHidden)
+ if (Clist_IsHidden(hContact))
Menu_ModifyItem(hmenuHide, LPGENW("Show in list"), IcoLib_GetIconHandle("miex_showil"));
else
Menu_ModifyItem(hmenuHide, LPGENW("Hide from list"), IcoLib_GetIconHandle("miex_hidefl"));
|