From 15c49e3fc4cf033fffbf79e9f68a0405d5a95d14 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Sep 2019 22:15:57 +0300 Subject: Clist_IsHidden / Clist_HideContact - two helpers to hide CList/Hidden variable and unify access to it --- protocols/YAMN/src/proto/pop3/pop3comm.cpp | 4 ++-- protocols/YAMN/src/services.cpp | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'protocols/YAMN/src') diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.cpp b/protocols/YAMN/src/proto/pop3/pop3comm.cpp index 93f7885135..2eb6f725f7 100644 --- a/protocols/YAMN/src/proto/pop3/pop3comm.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3comm.cpp @@ -289,10 +289,10 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) g_plugin.setWord(Finder->hContact, "Status", ID_STATUS_ONLINE); db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message")); if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) - db_unset(Finder->hContact, "CList", "Hidden"); + Clist_HideContact(Finder->hContact, false); if (!(Finder->Flags & YAMN_ACC_ENA) || !(Finder->NewMailN.Flags & YAMN_ACC_CONT)) - db_set_b(Finder->hContact, "CList", "Hidden", 1); + Clist_HideContact(Finder->hContact); } db_free(&dbv); } diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp index 771367d479..0ba33321ee 100644 --- a/protocols/YAMN/src/services.cpp +++ b/protocols/YAMN/src/services.cpp @@ -427,16 +427,13 @@ void CreateServiceFunctions(void) CreateServiceFunction(MS_YAMN_CLISTCONTEXTAPP, ContactApplication); } -//Function to put all enabled contact to the Online status +// Function to put all enabled contact to the Online status void RefreshContact(void) { CAccount *Finder; for (Finder = POP3Plugin->FirstAccount; Finder != nullptr; Finder = Finder->Next) { if (Finder->hContact != NULL) { - if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) - db_unset(Finder->hContact, "CList", "Hidden"); - else - db_set_b(Finder->hContact, "CList", "Hidden", 1); + Clist_HideContact(Finder->hContact, !(Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)); } else if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) { Finder->hContact = db_add_contact(); -- cgit v1.2.3