diff options
-rw-r--r-- | include/m_clistint.h | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 29 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcitems.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcmsgs.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 32 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcmsgs.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmenus.cpp | 9 | ||||
-rw-r--r-- | src/mir_app/src/clc.cpp | 24 | ||||
-rw-r--r-- | src/mir_app/src/clcitems.cpp | 6 | ||||
-rw-r--r-- | src/mir_app/src/clcmsgs.cpp | 28 | ||||
-rw-r--r-- | src/mir_app/src/clistmod.cpp | 2 |
11 files changed, 73 insertions, 75 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index a1c3f899ae..a7d2ca6b8f 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -260,7 +260,7 @@ EXTERN_C MIR_APP_DLL(void) Clist_DrawMenuItem(DRAWITEMSTRUCT *dis, HICON hI EXTERN_C MIR_APP_DLL(void) Clist_EndRename(ClcData *dat, int save);
EXTERN_C MIR_APP_DLL(void) Clist_EnsureVisible(HWND hwnd, ClcData *dat, int iItem, int partialOk);
EXTERN_C MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index);
-EXTERN_C MIR_APP_DLL(bool) Clist_FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
+EXTERN_C MIR_APP_DLL(bool) Clist_FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup = 0, int *isVisible = 0);
EXTERN_C MIR_APP_DLL(DWORD) Clist_GetDefaultExStyle(void);
EXTERN_C MIR_APP_DLL(void) Clist_GetFontSetting(int i, LOGFONT *lf, COLORREF *colour);
EXTERN_C MIR_APP_DLL(int) Clist_GetGeneralizedStatus(char **szProto = nullptr);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 8e46ef4971..ce6d9b2313 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -536,7 +536,7 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM if (ht) {
ClcContact *contact2;
ClcGroup *group2;
- if (Clist_FindItem(hwnd, dat, contact->hContact, &contact2, &group2, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, contact->hContact, &contact2, &group2)) {
int i = cliGetRowsPriorTo(&dat->list, group2, group2->cl.indexOf(contact2));
Clist_EnsureVisible(hwnd, dat, i + contact->iSubAllocated, 0);
}
@@ -627,11 +627,10 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR g_clistApi.pfnSortCLC(hwnd, dat, 1);
cliRecalcScrollBar(hwnd, dat);
if (ht) {
- int i = 0;
ClcContact *contact;
ClcGroup *group;
- if (Clist_FindItem(hwnd, dat, hitcontact->hContact, &contact, &group, nullptr)) {
- i = cliGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
+ if (Clist_FindItem(hwnd, dat, hitcontact->hContact, &contact, &group)) {
+ int i = cliGetRowsPriorTo(&dat->list, group, group->cl.indexOf(contact));
Clist_EnsureVisible(hwnd, dat, i + hitcontact->iSubAllocated, 0);
}
}
@@ -1300,7 +1299,7 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wPara BYTE flags = 0;
ClcContact *contact;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -1310,7 +1309,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;
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -1354,13 +1353,13 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam ClcGroup *group = nullptr;
ClcContact *contact = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr)) {
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group)) {
if (shouldShow && db_is_contact(wParam)) {
if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
needRepaint = TRUE;
- Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr);
+ Clist_FindItem(hwnd, dat, wParam, &contact);
if (contact) {
contact->iImage = lParam;
contact->bImageIsSpecial = bImageIsSpecial;
@@ -1401,7 +1400,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam }
if (hSelItem) {
- if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
@@ -1425,7 +1424,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 (Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, hContact, &contact))
Cache_GetAvatar(dat, contact);
else if (hContact == 0)
UpdateAllAvatars(dat);
@@ -1437,7 +1436,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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact) {
@@ -1453,7 +1452,7 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP LRESULT ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
ClcContact *contact;
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, &contact))
Cache_GetText(dat, contact);
return ret;
@@ -1470,7 +1469,7 @@ static LRESULT clcOnIntmStatusMsgChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR return corecli.pfnContactListControlWndProc(hwnd, msg, hContact, lParam);
ClcContact *contact;
- if (!Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact))
return corecli.pfnContactListControlWndProc(hwnd, msg, hContact, lParam);
if (contact) {
@@ -1486,7 +1485,7 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
ClcContact *contact;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) /////////////// ??
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact->type != CLCIT_CONTACT)
@@ -1518,7 +1517,7 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM if (wParam != 0) {
ClcContact *contact;
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) { /////////////////// ??
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
ClcCacheEntry *pdnce = contact->pce;
if (pdnce && pdnce->szProto) {
if (!dat->bForceInDialog) {
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 593fe7fb9d..344d0aaae5 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -189,7 +189,7 @@ void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int update ClcGroup *group;
ClcContact *cont;
- if (Clist_FindItem(hwnd, dat, hContact, &cont, &group, nullptr))
+ if (Clist_FindItem(hwnd, dat, hContact, &cont, &group))
_LoadDataToContact(cont, pdnce, group, dat, hContact);
}
@@ -216,7 +216,7 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected) {
ClcGroup *selgroup = nullptr;
ClcContact *selcontact = nullptr;
- if (!hSelected || !Clist_FindItem(dat->hWnd, dat, hSelected, &selcontact, &selgroup, nullptr)) {
+ if (!hSelected || !Clist_FindItem(dat->hWnd, dat, hSelected, &selcontact, &selgroup)) {
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 c05679e86b..b6825a2fc8 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 (!Clist_FindItem(hwnd, dat, lParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, lParam, &contact, &group))
return 0;
i = group->cl.indexOf(contact);
if (i < 0)
@@ -187,7 +187,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wP {
int index = -1;
int mainindex = -1;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
g_clistApi.pfnSetGroupExpand(hwnd, dat, tgroup, 1);
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index f26da696c6..9ed16ff995 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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
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 Clist_DeleteItemFromTree(hwnd, wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(wParam, nullptr, dat)) {
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
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 : !Clist_IsHiddenMode(dat, status)) ||
Clist_GetContactIcon(hContact) != lParam); // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
- if (!Clist_FindItem(hwnd, dat, hContact, &contact, &group, nullptr)) {
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact, &group)) {
if (shouldShow && db_is_contact(wParam)) {
if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
g_clistApi.pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
- Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(hwnd, dat, hContact, &contact);
if (contact) {
contact->iImage = (WORD)lParam;
Clist_NotifyNewContact(hwnd, hContact);
@@ -357,7 +357,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
if (hSelItem) {
ClcGroup *selgroup;
- if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
dat->selection = g_clistApi.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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
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 (!Clist_FindItem(hwnd, dat, contact->hSubContact, &subContact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, contact->hSubContact, &subContact))
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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
if (lParam == 0)
Clist_InitAutoRebuild(hwnd);
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_NAMECHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
contact->ace = cEntry;
@@ -460,7 +460,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L TExtraCache *p;
char *szProto = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
p = cfg::getCache(wParam, nullptr);
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 (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
WORD wStatus = db_get_w(wParam, contact->pce->szProto, "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 (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
contact->pce->szProto = 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 (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
char *szProto = (char*)cws->szModule;
if (szProto == nullptr)
@@ -542,7 +542,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L MCONTACT hContact = wParam;
TExtraCache *p;
- if (!Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr)) {
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact)) {
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 180c8e71d7..ff3f8a5611 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 || !Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
+ if (wParam == 0 || !Clist_FindItem(hwnd, dat, wParam, &contact, &group))
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 = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
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 = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
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 = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
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 3aba1439c4..9856b15cf0 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -91,7 +91,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) {
- Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact);
if (contact && contact->type != CLCIT_CONTACT) {
DestroyWindow(hWnd);
return FALSE;
@@ -198,7 +198,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;
- Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact);
if (iSel != CB_ERR) {
dwFlags &= ~(ECF_FORCEAVATAR | ECF_HIDEAVATAR);
@@ -285,7 +285,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_USER + 120: // set visibility status
{
ClcContact *contact = nullptr;
- if (Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact)) {
if (contact) {
WORD wApparentMode = db_get_w(contact->hContact, contact->pce->szProto, "ApparentMode", 0);
@@ -299,8 +299,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_USER + 130: // update apparent mode
{
ClcContact *contact = nullptr;
-
- if (Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_clistApi.hwndContactTree, cfg::clcdat, hContact, &contact)) {
if (contact) {
WORD wApparentMode = 0;
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 6758a23958..fae2dea563 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -376,7 +376,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam int groupId = atoi(dbcws->szSetting) + 1;
// check name of group and ignore message if just being expanded/collapsed
- if (Clist_FindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, groupId | HCONTACT_ISGROUP, &contact, &group)) {
CMStringW szFullName(contact->szText);
while (group->parent) {
ClcContact *cc = nullptr;
@@ -429,7 +429,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN)
break;
if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) {
- if (Clist_FindItem(hwnd, dat, wParam, nullptr, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, nullptr))
break;
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
Clist_NotifyNewContact(hwnd, wParam);
@@ -445,7 +445,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam {
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -455,7 +455,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b(wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -491,12 +491,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam contact = nullptr;
group = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr)) {
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group)) {
if (shouldShow && db_is_contact(wParam)) {
if (dat->selection >= 0 && g_clistApi.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
g_clistApi.pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
- Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr);
+ Clist_FindItem(hwnd, dat, wParam, &contact);
if (contact) {
contact->iImage = (WORD)lParam;
Clist_NotifyNewContact(hwnd, wParam);
@@ -523,7 +523,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam }
if (hSelItem) {
ClcGroup *selgroup;
- if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup))
dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
@@ -533,7 +533,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case INTM_NAMECHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
@@ -542,7 +542,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case INTM_PROTOCHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
contact->pce->szProto = GetContactProto(wParam);
@@ -552,7 +552,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case INTM_NOTONLISTCHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
if (contact->type == CLCIT_CONTACT) {
@@ -570,7 +570,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case INTM_APPARENTMODECHANGED:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
char *szProto = GetContactProto(wParam);
if (szProto == nullptr)
break;
@@ -592,7 +592,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
case INTM_IDLECHANGED:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact)) {
char *szProto = GetContactProto(wParam);
if (szProto == nullptr)
break;
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 851dfaf549..12765d49ef 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -304,7 +304,7 @@ MIR_APP_DLL(void) Clist_DeleteItemFromTree(HWND hwnd, MCONTACT hItem) ClcGroup *group; ClcContact *contact; - if (!Clist_FindItem(hwnd, dat, hItem, &contact, &group, nullptr)) { + if (!Clist_FindItem(hwnd, dat, hItem, &contact, &group)) { DBVARIANT dbv; int i, nameOffset; if (!IsHContactContact(hItem)) @@ -582,7 +582,7 @@ void fnSortCLC(HWND hwnd, ClcData *dat, int useInsertionSort) if (hSelItem) { ClcGroup *selgroup; - if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr)) + if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup)) dat->selection = g_clistApi.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact)); } @@ -703,7 +703,7 @@ MIR_APP_DLL(void) Clist_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) group = &dat->list; else { ClcContact *contact; - if (!Clist_FindItem(hwnd, dat, it->parentId | HCONTACT_ISGROUP, &contact, nullptr, nullptr)) + if (!Clist_FindItem(hwnd, dat, it->parentId | HCONTACT_ISGROUP, &contact)) continue; group = contact->group; } diff --git a/src/mir_app/src/clcmsgs.cpp b/src/mir_app/src/clcmsgs.cpp index 27fa517b22..21444b2d10 100644 --- a/src/mir_app/src/clcmsgs.cpp +++ b/src/mir_app/src/clcmsgs.cpp @@ -60,7 +60,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar if (cii->hParentGroup == nullptr)
group = &dat->list;
else {
- if (!Clist_FindItem(hwnd, dat, INT_PTR(cii->hParentGroup) | HCONTACT_ISGROUP, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, INT_PTR(cii->hParentGroup) | HCONTACT_ISGROUP, &contact))
return 0;
group = contact->group;
}
@@ -96,7 +96,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
case CLM_ENSUREVISIBLE:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group))
break;
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
@@ -105,18 +105,18 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
case CLM_EXPAND:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, &contact))
if (contact->type == CLCIT_GROUP)
g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, lParam);
break;
case CLM_FINDCONTACT:
- if (!Clist_FindItem(hwnd, dat, wParam, nullptr, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, nullptr))
return 0;
return wParam;
case CLM_FINDGROUP:
- if (!Clist_FindItem(hwnd, dat, wParam | HCONTACT_ISGROUP, nullptr, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam | HCONTACT_ISGROUP, nullptr))
return 0;
return wParam | HCONTACT_ISGROUP;
@@ -124,7 +124,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return dat->bkColour;
case CLM_GETCHECKMARK:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
return (contact->flags & CONTACTF_CHECKED) != 0;
@@ -135,7 +135,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return (LRESULT)dat->hwndRenameEdit;
case CLM_GETEXPAND:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return CLE_INVALID;
if (contact->type != CLCIT_GROUP)
return CLE_INVALID;
@@ -151,7 +151,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar case CLM_GETEXTRAIMAGE:
if (LOWORD(lParam) < dat->extraColumnsCount) {
- if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (Clist_FindItem(hwnd, dat, wParam, &contact))
return contact->iExtraImage[LOWORD(lParam)];
}
return EMPTY_EXTRA_ICON;
@@ -175,13 +175,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return mir_wstrlen(dat->szQuickSearch);
case CLM_GETITEMTEXT:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
mir_wstrcpy((wchar_t*)lParam, contact->szText);
return mir_wstrlen(contact->szText);
case CLM_GETITEMTYPE:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return CLCIT_INVALID;
return contact->type;
@@ -202,7 +202,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return 0;
}
- if (!Clist_FindItem(hwnd, dat, lParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, lParam, &contact, &group))
return 0;
i = group->cl.indexOf(contact);
@@ -295,7 +295,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar return Clist_ContactToHItem(contact);
case CLM_SELECTITEM:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, &group))
break;
for (ClcGroup *tgroup = group; tgroup; tgroup = tgroup->parent)
@@ -326,7 +326,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
case CLM_SETCHECKMARK:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
return 0;
if (lParam)
contact->flags |= CONTACTF_CHECKED;
@@ -403,7 +403,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wPar break;
case CLM_SETITEMTEXT:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact))
break;
mir_wstrncpy(contact->szText, (wchar_t*)lParam, _countof(contact->szText));
g_clistApi.pfnSortCLC(hwnd, dat, 1);
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index 7b31bc49df..9dba34d34a 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -375,7 +375,7 @@ MIR_APP_DLL(int) Clist_ContactCompare(MCONTACT hContact1, MCONTACT hContact2) ClcData *dat = (ClcData*)GetWindowLongPtr(g_clistApi.hwndContactTree, 0);
if (dat != nullptr) {
ClcContact *p1, *p2;
- if (Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact1, &p1, nullptr, nullptr) && Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact2, &p2, nullptr, nullptr))
+ if (Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact1, &p1) && Clist_FindItem(g_clistApi.hwndContactTree, dat, hContact2, &p2))
return g_clistApi.pfnCompareContacts(p1, p2);
}
|