summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp65
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp10
2 files changed, 37 insertions, 38 deletions
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 0c64572590..cc5575cbf1 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -51,38 +51,39 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
cacheEntry = pcli->pfnGetCacheEntry(hsub);
WORD wStatus = pdnce___GetStatus(cacheEntry);
- if (showOfflineHereGroup || !bHideOffline || wStatus != ID_STATUS_OFFLINE) {
- ClcContact& p = cont->subcontacts[i];
- p.hContact = cacheEntry->hContact;
-
- p.avatar_pos = AVATAR_POS_DONT_HAVE;
- Cache_GetAvatar(dat, &p);
-
- p.iImage = corecli.pfnGetContactIcon(cacheEntry->hContact);
- memset(p.iExtraImage, 0xFF, sizeof(p.iExtraImage));
- p.proto = cacheEntry->m_cache_cszProto;
- p.type = CLCIT_CONTACT;
- p.flags = 0;//CONTACTF_ONLINE;
- p.isSubcontact = i + 1;
- p.lastPaintCounter = 0;
- p.subcontacts = cont;
- p.image_is_special = FALSE;
- //p.status = cacheEntry->status;
- Cache_GetTimezone(dat, (&p)->hContact);
- Cache_GetText(dat, &p, 1);
-
- char *szProto = cacheEntry->m_cache_cszProto;
- if (szProto != NULL && !pcli->pfnIsHiddenMode(dat, wStatus))
- p.flags |= CONTACTF_ONLINE;
- int apparentMode = szProto != NULL ? cacheEntry->ApparentMode : 0;
- if (apparentMode == ID_STATUS_OFFLINE) p.flags |= CONTACTF_INVISTO;
- else if (apparentMode == ID_STATUS_ONLINE) p.flags |= CONTACTF_VISTO;
- else if (apparentMode) p.flags |= CONTACTF_VISTO | CONTACTF_INVISTO;
- if (cacheEntry->NotOnList) p.flags |= CONTACTF_NOTONLIST;
- int idleMode = szProto != NULL ? cacheEntry->IdleTS : 0;
- if (idleMode) p.flags |= CONTACTF_IDLE;
- i++;
- }
+ if (!showOfflineHereGroup && bHideOffline && !cacheEntry->m_cache_nNoHiddenOffline && wStatus == ID_STATUS_OFFLINE)
+ continue;
+
+ ClcContact& p = cont->subcontacts[i];
+ p.hContact = cacheEntry->hContact;
+
+ p.avatar_pos = AVATAR_POS_DONT_HAVE;
+ Cache_GetAvatar(dat, &p);
+
+ p.iImage = corecli.pfnGetContactIcon(cacheEntry->hContact);
+ memset(p.iExtraImage, 0xFF, sizeof(p.iExtraImage));
+ p.proto = cacheEntry->m_cache_cszProto;
+ p.type = CLCIT_CONTACT;
+ p.flags = 0;//CONTACTF_ONLINE;
+ p.isSubcontact = i + 1;
+ p.lastPaintCounter = 0;
+ p.subcontacts = cont;
+ p.image_is_special = FALSE;
+ //p.status = cacheEntry->status;
+ Cache_GetTimezone(dat, (&p)->hContact);
+ Cache_GetText(dat, &p, 1);
+
+ char *szProto = cacheEntry->m_cache_cszProto;
+ if (szProto != NULL && !pcli->pfnIsHiddenMode(dat, wStatus))
+ p.flags |= CONTACTF_ONLINE;
+ int apparentMode = szProto != NULL ? cacheEntry->ApparentMode : 0;
+ if (apparentMode == ID_STATUS_OFFLINE) p.flags |= CONTACTF_INVISTO;
+ else if (apparentMode == ID_STATUS_ONLINE) p.flags |= CONTACTF_VISTO;
+ else if (apparentMode) p.flags |= CONTACTF_VISTO | CONTACTF_INVISTO;
+ if (cacheEntry->NotOnList) p.flags |= CONTACTF_NOTONLIST;
+ int idleMode = szProto != NULL ? cacheEntry->IdleTS : 0;
+ if (idleMode) p.flags |= CONTACTF_IDLE;
+ i++;
}
cont->SubAllocated = i;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 538f30466e..fcad83ee28 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -145,8 +145,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
mi.flags |= CMIM_FLAGS | CMIM_ICON;
Menu_ModifyItem(hFavoriteContactMenuItems[i], &mi);
}
- else
- hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
+ else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
}
mi.hIcon = NULL;
@@ -159,8 +158,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
mi.flags |= CMIM_FLAGS | CMIM_ICON;
Menu_ModifyItem(hShowIfOflineItem, &mi);
}
- else
- hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
+ else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
return 0;
}
@@ -168,7 +166,7 @@ static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- db_set_b((MCONTACT)hContact, "CList", "Rate", (BYTE)nRate);
+ db_set_b(hContact, "CList", "Rate", (BYTE)nRate);
return 0;
}
@@ -176,7 +174,7 @@ INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM lParam)
{
if (hContact)
- db_set_b((MCONTACT)hContact, "CList", "noOffline", !db_get_b((MCONTACT)hContact, "CList", "noOffline", 0));
+ db_set_b(hContact, "CList", "noOffline", !db_get_b(hContact, "CList", "noOffline", 0));
return 0;
}