From 403ee5e18b2393a430ff5e9d3f0cb5feccdb341e Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 16 Apr 2016 12:01:20 +0000 Subject: Clist_modern: fix sorting by status git-svn-id: http://svn.miranda-ng.org/main/trunk@16674 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_contact.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 891168dffb..297b366c1e 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -105,7 +105,8 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) ClcCacheEntry *c2 = cliGetCacheEntry(contact2->hContact); for (int i = 0; i < _countof(g_CluiData.bSortByOrder); i++) { - int by = g_CluiData.bSortByOrder[i]; + BYTE &by = g_CluiData.bSortByOrder[i]; + if (by == SORTBY_STATUS) { //status int ordera = GetStatusModeOrdering(c1->getStatus()); int orderb = GetStatusModeOrdering(c2->getStatus()); @@ -117,12 +118,13 @@ int cliCompareContacts(const ClcContact *contact1, const ClcContact *contact2) // one is offline: offline goes below online if (g_CluiData.fSortNoOfflineBottom == 0) { int statusa = c1->getStatus(); - int statusb = c1->getStatus(); + int statusb = c2->getStatus(); if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) return 2 * (statusa == ID_STATUS_OFFLINE) - 1; } - int r; + int r = 0; + switch (by) { case SORTBY_NAME: // name r = mir_tstrcmpi(contact1->szText, contact2->szText); -- cgit v1.2.3