diff options
author | George Hazan <ghazan@miranda.im> | 2018-09-18 13:03:10 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-09-18 13:03:10 +0300 |
commit | 9a2b18ce1d76687094322699b077b0e3d66f1ecd (patch) | |
tree | 299e30e9ac41609fb92b1806c7a31d7a3a591c8f /plugins/Clist_nicer | |
parent | d6edbc9108a3ea183774c84993f679e824ad8a6f (diff) |
code cleaning
Diffstat (limited to 'plugins/Clist_nicer')
-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 |
3 files changed, 24 insertions, 25 deletions
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;
|