summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/chat_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src/chat_manager.cpp')
-rw-r--r--plugins/TabSRMM/src/chat_manager.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/TabSRMM/src/chat_manager.cpp b/plugins/TabSRMM/src/chat_manager.cpp
index c40ed9e821..e2232e6050 100644
--- a/plugins/TabSRMM/src/chat_manager.cpp
+++ b/plugins/TabSRMM/src/chat_manager.cpp
@@ -44,29 +44,26 @@ static int sttCompareNicknames(const wchar_t *s1, const wchar_t *s2)
return mir_wstrcmpi(s1, s2);
}
-int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus)
+int UM_CompareItem(const USERINFO *u1, const USERINFO *u2)
{
WORD dw1 = u1->Status;
- WORD dw2 = wStatus;
+ WORD dw2 = u2->Status;
for (int i = 0; i < 8; i++) {
if ((dw1 & 1) && !(dw2 & 1))
return -1;
if ((dw2 & 1) && !(dw1 & 1))
return 1;
- if ((dw1 & 1) && (dw2 & 1)) {
- if (g_Settings.bAlternativeSorting)
- return sttCompareNicknames(u1->pszNick, pszNick);
- else
- return mir_wstrcmp(u1->pszNick, pszNick);
- }
+ if ((dw1 & 1) && (dw2 & 1))
+ break;
+
dw1 = dw1 >> 1;
dw2 = dw2 >> 1;
}
if (g_Settings.bAlternativeSorting)
- return sttCompareNicknames(u1->pszNick, pszNick);
- return mir_wstrcmp(u1->pszNick, pszNick);
+ return sttCompareNicknames(u1->pszNick, u2->pszNick);
+ return mir_wstrcmp(u1->pszNick, u2->pszNick);
}
//---------------------------------------------------