summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-26 11:01:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-26 11:01:47 +0000
commitf1f98fe541c790141fec87b943af535a943c7100 (patch)
tree7f86c2045262dca0f41b495bf6748f0b122667f5 /plugins
parent5f5270854027fbafc77086cdfad554a9fee2faa2 (diff)
- duplicated code removed from cliFindItem;
- FindItem function removed completely; - CLIST_INTERFACE::pfnFindItem now only compare one item; - static function Clist_FindItem now serves as pcli->pfnFindItem git-svn-id: http://svn.miranda-ng.org/main/trunk@17335 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp26
-rw-r--r--plugins/Clist_modern/src/modern_clc.h1
-rw-r--r--plugins/Clist_modern/src/modern_clcidents.cpp82
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h54
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp3
-rw-r--r--plugins/Clist_nicer/src/clc.cpp32
-rw-r--r--plugins/Clist_nicer/src/clcmsgs.cpp8
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp8
10 files changed, 76 insertions, 146 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 6d5f29ad3f..fcfbb3d154 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -526,7 +526,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
if (ht) {
ClcContact *contact2;
ClcGroup *group2;
- if (FindItem(hwnd, dat, contact->hContact, &contact2, &group2, NULL, false)) {
+ if (Clist_FindItem(hwnd, dat, contact->hContact, &contact2, &group2, NULL)) {
int i = cliGetRowsPriorTo(&dat->list, group2, GetContactIndex(group2, contact2));
pcli->pfnEnsureVisible(hwnd, dat, i + contact->iSubAllocated, 0);
}
@@ -620,7 +620,7 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
int i = 0;
ClcContact *contact;
ClcGroup *group;
- if (FindItem(hwnd, dat, hitcontact->hContact, &contact, &group, NULL, false)) {
+ if (Clist_FindItem(hwnd, dat, hitcontact->hContact, &contact, &group, NULL)) {
i = cliGetRowsPriorTo(&dat->list, group, GetContactIndex(group, contact));
pcli->pfnEnsureVisible(hwnd, dat, i + hitcontact->iSubAllocated, 0);
}
@@ -1290,7 +1290,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wPara
BYTE flags = 0;
ClcContact *contact;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -1300,7 +1300,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wPara
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -1344,13 +1344,13 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
ClcGroup *group = NULL;
ClcContact *contact = NULL;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL)) {
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, NULL)) {
if (shouldShow && db_is_contact(wParam)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
needRepaint = TRUE;
- pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL);
+ Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = lParam;
contact->bImageIsSpecial = bImageIsSpecial;
@@ -1391,7 +1391,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
}
if (hSelItem) {
- if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
@@ -1415,7 +1415,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT, WPARAM hContact, LPARAM)
{
ClcContact *contact;
- if (FindItem(hwnd, dat, hContact, &contact, NULL, NULL, false))
+ if (Clist_FindItem(hwnd, dat, hContact, &contact, NULL, NULL))
Cache_GetAvatar(dat, contact);
else if (hContact == 0)
UpdateAllAvatars(dat);
@@ -1427,7 +1427,7 @@ static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT, WPARAM hCon
static LRESULT clcOnIntmTimeZoneChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- if (!FindItem(hwnd, dat, wParam, &contact, NULL, NULL, false))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact) {
@@ -1443,7 +1443,7 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
LRESULT ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
ClcContact *contact;
- if (FindItem(hwnd, dat, wParam, &contact, NULL, NULL, false))
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
Cache_GetText(dat, contact);
return ret;
@@ -1460,7 +1460,7 @@ static LRESULT clcOnIntmStatusMsgChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR
return corecli.pfnContactListControlWndProc(hwnd, msg, hContact, lParam);
ClcContact *contact;
- if (!FindItem(hwnd, dat, hContact, &contact, NULL, NULL, false))
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact, NULL, NULL))
return corecli.pfnContactListControlWndProc(hwnd, msg, hContact, lParam);
if (contact) {
@@ -1476,7 +1476,7 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
ClcContact *contact;
- if (!FindItem(hwnd, dat, wParam, &contact, NULL, NULL, true))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) /////////////// ??
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact->type != CLCIT_CONTACT)
@@ -1508,7 +1508,7 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM
if (wParam != 0) {
ClcContact *contact;
- if (FindItem(hwnd, dat, wParam, &contact, NULL, NULL, true)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) { /////////////////// ??
ClcCacheEntry *pdnce = contact->pce;
if (pdnce && pdnce->m_pszProto) {
if (!dat->bForceInDialog) {
diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h
index f8413b9bff..f05184b1d3 100644
--- a/plugins/Clist_modern/src/modern_clc.h
+++ b/plugins/Clist_modern/src/modern_clc.h
@@ -335,7 +335,6 @@ void ClcOptionsChanged(void);
// clcidents.c
int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
-int FindItem(HWND hwnd, ClcData *dat, DWORD hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, bool isIgnoreSubcontacts);
int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
// clcitems.c
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp
index f1d7a96ce8..03ef670329 100644
--- a/plugins/Clist_modern/src/modern_clcidents.cpp
+++ b/plugins/Clist_modern/src/modern_clcidents.cpp
@@ -77,84 +77,16 @@ int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex)
return -1;
}
-int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
+ClcContact* cliFindItem(DWORD dwItem, ClcContact *cc)
{
- return FindItem(hwnd, dat, dwItem, contact, subgroup, isVisible, false);
-}
-
-int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, bool isIgnoreSubcontacts)
-{
- int index = 0;
- int nowVisible = 1;
-
- ClcGroup *group = &dat->list;
- group->scanIndex = 0;
- group = &dat->list;
-
- for (;;) {
- if (group->scanIndex == group->cl.getCount()) {
- if ((group = group->parent) == NULL)
- break;
-
- nowVisible = 1;
- for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
- if (!tgroup->expanded) {
- nowVisible = 0;
- break;
- }
-
- group->scanIndex++;
- continue;
- }
-
- if (nowVisible)
- index++;
-
- ClcContact *cc = group->cl[group->scanIndex];
- if ((IsHContactGroup(dwItem) && cc->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == cc->groupId) ||
- (IsHContactContact(dwItem) && cc->type == CLCIT_CONTACT && cc->hContact == dwItem) ||
- (IsHContactInfo(dwItem) && cc->type == CLCIT_INFO && cc->hContact == (dwItem & ~HCONTACT_ISINFO))) {
- if (isVisible) {
- if (!nowVisible) *isVisible = 0;
- else {
- int posy = cliGetRowTopY(dat, index + 1);
- if (posy < dat->yScroll)
- *isVisible = 0;
- else {
- RECT clRect;
- GetClientRect(hwnd, &clRect);
- *isVisible = (posy < dat->yScroll + clRect.bottom);
- }
- }
- }
- if (contact) *contact = cc;
- if (subgroup) *subgroup = group;
-
- return 1;
- }
+ if (corecli.pfnFindItem(dwItem, cc))
+ return cc;
- if (!isIgnoreSubcontacts && IsHContactContact(dwItem) && cc->type == CLCIT_CONTACT && cc->iSubAllocated > 0) {
- for (int i = 0; i < cc->iSubAllocated; i++) {
- if (cc->subcontacts[i].hContact == dwItem) {
- if (contact) *contact = &cc->subcontacts[i];
- if (subgroup) *subgroup = group;
- return 1;
- }
- }
- }
-
- if (cc->type == CLCIT_GROUP) {
- group = cc->group;
- group->scanIndex = 0;
- nowVisible &= group->expanded;
- continue;
- }
- group->scanIndex++;
- }
+ if (IsHContactContact(dwItem) && cc->type == CLCIT_CONTACT && cc->iSubAllocated > 0)
+ for (int i = 0; i < cc->iSubAllocated; i++)
+ if (cc->subcontacts[i].hContact == dwItem)
+ return &cc->subcontacts[i];
- if (isVisible) *isVisible = FALSE;
- if (contact) *contact = NULL;
- if (subgroup) *subgroup = NULL;
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index c10c11a20e..513d431453 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -186,7 +186,7 @@ void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int update
ClcGroup *group;
ClcContact *cont;
- if (FindItem(hwnd, dat, hContact, &cont, &group, NULL, false))
+ if (Clist_FindItem(hwnd, dat, hContact, &cont, &group, NULL))
_LoadDataToContact(cont, pdnce, group, dat, hContact);
}
@@ -213,7 +213,7 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected)
{
ClcGroup *selgroup = NULL;
ClcContact *selcontact = NULL;
- if (!hSelected || !pcli->pfnFindItem(dat->hWnd, dat, hSelected, &selcontact, &selgroup, NULL)) {
+ if (!hSelected || !Clist_FindItem(dat->hWnd, dat, hSelected, &selcontact, &selgroup, NULL)) {
dat->selection = -1;
return dat->selection;
}
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index 649d39736f..8960aaae5b 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -106,7 +106,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP
{
int i = 0;
if (wParam != CLGN_ROOT) {
- if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL))
+ if (!Clist_FindItem(hwnd, dat, lParam, &contact, &group, NULL))
return NULL;
i = group->cl.indexOf(contact);
if (i < 0) return 0;
@@ -187,7 +187,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP
{
int index = -1;
int mainindex = -1;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index e48b78c646..c898f33c57 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -227,34 +227,36 @@ void ToolbarButtonUnloadModule();
// INTERFACES
-void cliCheckCacheItem(ClcCacheEntry *pdnce);
-void cliFreeCacheItem(ClcCacheEntry *p);
-void cliRebuildEntireList(HWND hwnd, ClcData *dat);
-void cliRecalcScrollBar(HWND hwnd, ClcData *dat);
-int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
-int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
-int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
-int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
-int cli_GetContactIcon(MCONTACT hContact);
-int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
-void cli_FreeContact(ClcContact*);
-void cli_SetContactCheckboxes(ClcContact*, int);
-LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
+void cliCheckCacheItem(ClcCacheEntry *pdnce);
+void cliFreeCacheItem(ClcCacheEntry *p);
+void cliRebuildEntireList(HWND hwnd, ClcData *dat);
+void cliRecalcScrollBar(HWND hwnd, ClcData *dat);
+int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
+int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
+int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
+int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
+int cli_GetContactIcon(MCONTACT hContact);
+int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
+void cli_FreeContact(ClcContact*);
+void cli_SetContactCheckboxes(ClcContact*, int);
+LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
+int cliShowHide(bool bAlwaysShow);
+BOOL cliInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase);
+int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2);
+int cliTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
+void cliCluiProtocolStatusChanged(int status, const char *proto);
+void cliInvalidateDisplayNameCacheEntry(MCONTACT hContact);
+void CLUI_cli_LoadCluiGlobalOpts(void);
+INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
+int cliTrayIconInit(HWND hwnd);
+int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
+
CListEvent* cli_AddEvent(CLISTEVENT *cle);
+
LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-int cliShowHide(bool bAlwaysShow);
-BOOL cliInvalidateRect(HWND hWnd, CONST RECT *lpRect, BOOL bErase);
-int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2);
-int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
-int cliTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam);
-void cliCluiProtocolStatusChanged(int status, const char *proto);
-void cliInvalidateDisplayNameCacheEntry(MCONTACT hContact);
-void CLUI_cli_LoadCluiGlobalOpts(void);
-INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
-int cliTrayIconInit(HWND hwnd);
-int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
-
-ClcContact* cliCreateClcContact(void);
+
+ClcContact* cliFindItem(DWORD dwItem, ClcContact *contact);
+ClcContact* cliCreateClcContact(void);
ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact);
#define WM_DWMCOMPOSITIONCHANGED 0x031E
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index 47ffcfc574..4cc7b523c6 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -90,9 +90,6 @@ int GetProtoIndex(char * szName)
int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2)
{
- if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100)
- return 0;
-
ClcCacheEntry *c1 = contact1->pce, *c2 = contact2->pce;
for (int i = 0; i < _countof(g_CluiData.bSortByOrder); i++) {
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index c3adacca29..407208798d 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -275,7 +275,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
{
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -284,7 +284,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
pcli->pfnDeleteItemFromTree(hwnd, wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(wParam, NULL, dat)) {
pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -322,13 +322,13 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
!CLVM_GetContactHiddenStatus(hContact, szProto, dat)) && ((cfg::dat.bFilterEffective ? TRUE : !pcli->pfnIsHiddenMode(dat, status)) ||
pcli->pfnGetContactIcon(hContact) != lParam); // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
- if (!pcli->pfnFindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
if (shouldShow && db_is_contact(wParam)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
- pcli->pfnFindItem(hwnd, dat, hContact, &contact, NULL, NULL);
+ Clist_FindItem(hwnd, dat, hContact, &contact, NULL, NULL);
if (contact) {
contact->iImage = (WORD)lParam;
pcli->pfnNotifyNewContact(hwnd, hContact);
@@ -357,7 +357,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
}
if (hSelItem) {
ClcGroup *selgroup;
- if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
@@ -371,7 +371,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_METACHANGED:
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
if (contact->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
@@ -381,7 +381,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
if (contact->pExtra) {
TExtraCache *pSub = cfg::getCache(contact->hSubContact, contact->metaProto);
ClcContact *subContact;
- if (!pcli->pfnFindItem(hwnd, dat, contact->hSubContact, &subContact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, contact->hSubContact, &subContact, NULL, NULL))
break;
contact->pExtra->proto_status_item = GetProtocolStatusItem(contact->metaProto);
@@ -395,14 +395,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_METACHANGEDEVENT:
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
if (lParam == 0)
pcli->pfnInitAutoRebuild(hwnd);
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_NAMECHANGED:
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
mir_wstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
@@ -413,7 +413,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_CODEPAGECHANGED:
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
contact->codePage = db_get_dw(wParam, "Tab_SRMsg", "ANSIcodepage", db_get_dw(wParam, "UserInfo", "ANSIcodepage", CP_ACP));
@@ -433,7 +433,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return DefWindowProc(hwnd, msg, wParam, lParam);
}
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
contact->ace = cEntry;
@@ -460,7 +460,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
TExtraCache *p;
char *szProto = NULL;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
p = cfg::getCache(wParam, NULL);
else {
p = contact->pExtra;
@@ -472,7 +472,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_STATUSCHANGED:
- if (pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
WORD wStatus = db_get_w(wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
if (cfg::dat.bNoOfflineAvatars && wStatus != ID_STATUS_OFFLINE && contact->wStatus == ID_STATUS_OFFLINE) {
contact->wStatus = wStatus;
@@ -485,7 +485,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
break;
case INTM_PROTOCHANGED:
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
break;
contact->proto = GetContactProto(wParam);
@@ -520,7 +520,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_IDLECHANGED:
- if (pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
char *szProto = (char*)cws->szModule;
if (szProto == NULL)
@@ -542,7 +542,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
MCONTACT hContact = wParam;
TExtraCache *p;
- if (!pcli->pfnFindItem(hwnd, dat, hContact, &contact, NULL, NULL)) {
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact, NULL, NULL)) {
p = cfg::getCache(hContact, szProto);
if (!dat->bisEmbedded && szProto) { // may be a subcontact, forward the xstatus
MCONTACT hMasterContact = db_mc_tryMeta(hContact);
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp
index 16859d8fa2..e4b0605ed8 100644
--- a/plugins/Clist_nicer/src/clcmsgs.cpp
+++ b/plugins/Clist_nicer/src/clcmsgs.cpp
@@ -33,7 +33,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
{
ClcContact *contact;
ClcGroup *group;
- if (wParam == 0 || !pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL))
+ if (wParam == 0 || !Clist_FindItem(hwnd, dat, wParam, &contact, &group, NULL))
return 0;
if (lParam)
@@ -46,7 +46,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_GETSTATUSMSG:
if (wParam) {
ClcContact *contact = NULL;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
@@ -65,7 +65,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_TOGGLEPRIORITYCONTACT:
if (wParam) {
ClcContact *contact = NULL;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
@@ -78,7 +78,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_QUERYPRIORITYCONTACT:
if (wParam) {
ClcContact *contact = NULL;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index 8f8f9b6018..5a71b78328 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -92,7 +92,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed by status message"));
if (cfg::clcdat) {
- pcli->pfnFindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL);
+ Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL);
if (contact && contact->type != CLCIT_CONTACT) {
DestroyWindow(hWnd);
return FALSE;
@@ -204,7 +204,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
LRESULT checked = 0;
- pcli->pfnFindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL);
+ Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL);
if (iSel != CB_ERR) {
dwFlags &= ~(ECF_FORCEAVATAR | ECF_HIDEAVATAR);
@@ -291,7 +291,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
case WM_USER + 120: // set visibility status
{
ClcContact *contact = NULL;
- if (pcli->pfnFindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
+ if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
if (contact) {
WORD wApparentMode = db_get_w(contact->hContact, contact->proto, "ApparentMode", 0);
@@ -306,7 +306,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
{
ClcContact *contact = NULL;
- if (pcli->pfnFindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
+ if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
if (contact) {
WORD wApparentMode = 0;