2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Don't allow reordering of the archive.

This commit is contained in:
John Preston
2019-04-18 15:31:30 +04:00
parent 74c65f30f7
commit 518ff146b2
13 changed files with 62 additions and 43 deletions

View File

@@ -29,8 +29,8 @@ uint64 DialogPosFromDate(TimeId date) {
return (uint64(date) << 32) | (++DialogsPosToTopShift);
}
uint64 ProxyPromotedDialogPos() {
return 0xFFFFFFFFFFFF0001ULL;
uint64 FixedOnTopDialogPos(int index) {
return 0xFFFFFFFFFFFF000FULL - index;
}
uint64 PinnedDialogPos(int pinnedIndex) {
@@ -87,8 +87,9 @@ void Entry::updateChatListSortPosition() {
updateChatListEntry();
return;
}
_sortKeyInChatList = useProxyPromotion()
? ProxyPromotedDialogPos()
const auto fixedIndex = fixedOnTopIndex();
_sortKeyInChatList = fixedIndex
? FixedOnTopDialogPos(fixedIndex)
: isPinnedDialog()
? PinnedDialogPos(_pinnedIndex)
: DialogPosFromDate(adjustedChatListTimeId());