diff options
author | George Hazan <ghazan@miranda.im> | 2018-10-13 21:29:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-10-13 21:29:05 +0300 |
commit | 1ba1e51fc6fa7e30b0a627a141348f515ffaba76 (patch) | |
tree | f73f73f96662e545d0c995d41b22ed5f2908a2a2 /plugins/TabSRMM/src/chat_manager.cpp | |
parent | 1724ed49a870a75f7608a8badc2a897ca471203d (diff) |
chat api:
- GC_SHAREDUSERS flag added to share the same array of users for all group chats;
- USERINFO.next removed;
- MODULEINFO.arUsers & SESSION_INFO.arUsers introduced to maintain user lists;
- MM_AddModule removed;
- memory allocation model changed for MODULEINFO & SESSION_INFO
- MM_CreateModule & SM_CreateSession members are added to g_chatApi
Diffstat (limited to 'plugins/TabSRMM/src/chat_manager.cpp')
-rw-r--r-- | plugins/TabSRMM/src/chat_manager.cpp | 17 |
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);
}
//---------------------------------------------------
|