From e375ccde7e1f274a557c7023d41677f9b8c92861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Thu, 2 Aug 2012 11:49:59 +0000 Subject: Clist_modern filtering respect hidden contacts/view modes. git-svn-id: http://svn.miranda-ng.org/main/trunk@1326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcitems.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plugins/Clist_modern/src/modern_clcitems.cpp') diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 412f961496..7550a420d5 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -750,6 +750,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc { int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it. int filterResult = 1; + int searchResult = 0; DBVARIANT dbv = {0}; char szTemp[64]; TCHAR szGroupMask[256]; @@ -766,7 +767,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc // search filtering TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(pdnce->tszName)); TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch)); - return _tcsstr(lowered_name, lowered_search) ? 0 : 1; + searchResult = _tcsstr(lowered_name, lowered_search) ? 0 : 1; } if (pdnce && g_CluiData.bFilterEffective && !fEmbedded) { if (szProto == NULL) @@ -776,9 +777,9 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc if ((dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) { if (g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS) { WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask)); + return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask)) | searchResult; } - return 0; + return 0 | searchResult; } } // check the proto, use it as a base filter result for all further checks @@ -813,8 +814,8 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc filterResult = filterResult & (pdnce->dwLastMsgTime > now); } } - return (dbHidden | !filterResult); + return (dbHidden | !filterResult | searchResult); } else - return dbHidden; + return dbHidden | searchResult; } -- cgit v1.2.3