From ddba4ede6b451d0cfcd0d32b5180fbd0689966bf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 08:04:30 +0000 Subject: - HANDLE hContact => HCONTACT - GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/contact.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/modules/clist/contact.cpp') diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 4a7be77ba1..92f7f5deda 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -45,7 +45,7 @@ static const struct { {ID_STATUS_ONTHEPHONE, 150}, {ID_STATUS_OUTTOLUNCH, 425}}; -static int GetContactStatus(HANDLE hContact) +static int GetContactStatus(HCONTACT hContact) { char *szProto = GetContactProto(hContact); if (szProto == NULL) @@ -53,7 +53,7 @@ static int GetContactStatus(HANDLE hContact) return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); } -void fnChangeContactIcon(HANDLE hContact, int iIcon, int add) +void fnChangeContactIcon(HCONTACT hContact, int iIcon, int add) { CallService(add ? MS_CLUI_CONTACTADDED : MS_CLUI_CONTACTSETICON, (WPARAM) hContact, iIcon); NotifyEventHooks(hContactIconChangedEvent, (WPARAM) hContact, iIcon); @@ -78,7 +78,7 @@ void fnLoadContactTree(void) } int hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT); - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { int status = GetContactStatus(hContact); if ((!hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0)) cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact), 1); @@ -90,13 +90,13 @@ void fnLoadContactTree(void) int fnCompareContacts(const ClcContact* c1, const ClcContact* c2) { - HANDLE a = c1->hContact, b = c2->hContact; + HCONTACT a = c1->hContact, b = c2->hContact; TCHAR namea[128], *nameb; int statusa, statusb; int rc; - statusa = db_get_w((HANDLE) a, c1->proto, "Status", ID_STATUS_OFFLINE); - statusb = db_get_w((HANDLE) b, c2->proto, "Status", ID_STATUS_OFFLINE); + statusa = db_get_w(a, c1->proto, "Status", ID_STATUS_OFFLINE); + statusb = db_get_w(b, c2->proto, "Status", ID_STATUS_OFFLINE); if (sortByProto) { /* deal with statuses, online contacts have to go above offline */ @@ -111,17 +111,15 @@ int fnCompareContacts(const ClcContact* c1, const ClcContact* c2) } if (sortByStatus) { - int ordera, orderb; - ordera = GetStatusModeOrdering(statusa); - orderb = GetStatusModeOrdering(statusb); + int ordera = GetStatusModeOrdering(statusa); + int orderb = GetStatusModeOrdering(statusb); if (ordera != orderb) return ordera - orderb; } else { //one is offline: offline goes below online - if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) { + if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) return 2 * (statusa == ID_STATUS_OFFLINE) - 1; - } } nameb = cli.pfnGetContactDisplayName(a, 0); @@ -146,13 +144,13 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) CallService(MS_CLUI_CONTACTDELETED, wParam, 0); if ((HANDLE) lParam == NULL) - db_unset((HANDLE)wParam, "CList", "Group"); + db_unset((HCONTACT)wParam, "CList", "Group"); else { grpChg.pszNewName = cli.pfnGetGroupName(lParam, NULL); - db_set_ts((HANDLE)wParam, "CList", "Group", grpChg.pszNewName); + db_set_ts((HCONTACT)wParam, "CList", "Group", grpChg.pszNewName); } CallService(MS_CLUI_CONTACTADDED, wParam, - cli.pfnIconFromStatusMode(GetContactProto((HANDLE)wParam), GetContactStatus((HANDLE)wParam), (HANDLE)wParam)); + cli.pfnIconFromStatusMode(GetContactProto((HCONTACT)wParam), GetContactStatus((HCONTACT)wParam), (HCONTACT)wParam)); NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg); return 0; -- cgit v1.2.3