diff options
Diffstat (limited to 'src/modules/clist/contact.cpp')
-rw-r--r-- | src/modules/clist/contact.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
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;
|