summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-08-02 11:49:59 +0000
committerRobert Pösel <robyer@seznam.cz>2012-08-02 11:49:59 +0000
commite375ccde7e1f274a557c7023d41677f9b8c92861 (patch)
tree76efeedf6c1d651e562033367d143022fdd39d2b /plugins/Clist_modern
parente61acad8085d66f210b03187955e5ce1923bd04a (diff)
Clist_modern filtering respect hidden contacts/view modes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@1326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp11
1 files changed, 6 insertions, 5 deletions
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;
}