From 9591bca42dfaeecdbcddd9c0986e3a9819abf92c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 15 Mar 2014 18:33:34 +0000 Subject: correct hiding/unhiding of subs when one turns MC on/off git-svn-id: http://svn.miranda-ng.org/main/trunk@8629 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_utils.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/modules/metacontacts/meta_utils.cpp') diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index 370295e59d..a30442c6ec 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -433,19 +433,24 @@ int Meta_HideLinkedContacts(void) return 0; } -int Meta_HideMetaContacts(int hide) +int Meta_HideMetaContacts(bool bHide) { // set status suppression - if (hide) - Meta_SuppressStatus(FALSE); - else - Meta_SuppressStatus(options.bSuppressStatus); + bool bSuppress = bHide ? FALSE : options.bSuppressStatus; for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - if (CheckMeta(hContact) == NULL) + bool bSet; + DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact); + if (cc->IsSub()) { // show on hide, reverse flag + bSet = !bHide; + CallService(bSuppress ? MS_IGNORE_IGNORE : MS_IGNORE_UNIGNORE, hContact, IGNOREEVENT_USERONLINE); + } + else if (cc->IsMeta()) + bSet = bHide; + else continue; - if (hide) + if (bSet) db_set_b(hContact, "CList", "Hidden", 1); else db_unset(hContact, "CList", "Hidden"); -- cgit v1.2.3