summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clcitems.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-01 09:11:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-01 09:11:39 +0000
commitea68d4474bb7329a5e59e0388b88155b96f31f7c (patch)
tree85229af10f8def74cf963924bffb8df53bdab83f /plugins/Clist_modern/src/modern_clcitems.cpp
parent9ba730bc48e44630b418f4214aee57c7b7c987bd (diff)
- view modes support incorporated into the CLIST_INTERFACE;
- fix for the broken search by protocols in clist_nicer; - numerous Unicode fixes in clist_nicer; git-svn-id: http://svn.miranda-ng.org/main/trunk@16893 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clcitems.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 4f47e2b360..777181b598 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -462,15 +462,11 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly)
// if no view mode is active, it returns the CList/Hidden setting
// also cares about sub contacts (if meta is active)
-int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
+int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat)
{
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];
- DWORD dwLocalMask;
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
// always hide subcontacts (but show them on embedded contact lists)
@@ -492,7 +488,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc
szProto = GetContactProto(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS) {
- if ((dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) {
+ if (DWORD dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 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)) | searchResult;
@@ -503,15 +499,17 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc
// check the proto, use it as a base filter result for all further checks
if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
+ char szTemp[64];
mir_snprintf(szTemp, "%s|", szProto);
filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- if (!db_get_ts(hContact, "CList", "Group", &dbv)) {
- mir_sntprintf(szGroupMask, _T("%s|"), &dbv.ptszVal[0]);
+ ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ if (tszGroup != NULL) {
+ TCHAR szGroupMask[256];
+ mir_sntprintf(szGroupMask, _T("%s|"), tszGroup);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
- mir_free(dbv.ptszVal);
}
else if (g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;