mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Pass FilterId to pinnedIndexChanged.
This commit is contained in:
parent
894e7c5828
commit
c4c234f0d3
2 changed files with 7 additions and 10 deletions
|
@ -63,8 +63,8 @@ Data::Folder *Entry::asFolder() {
|
|||
return _isFolder ? static_cast<Data::Folder*>(this) : nullptr;
|
||||
}
|
||||
|
||||
void Entry::pinnedIndexChanged(int was, int now) {
|
||||
if (session().supportMode()) {
|
||||
void Entry::pinnedIndexChanged(FilterId filterId, int was, int now) {
|
||||
if (!filterId && session().supportMode()) {
|
||||
// Force reorder in support mode.
|
||||
_sortKeyInChatList = 0;
|
||||
}
|
||||
|
@ -83,15 +83,12 @@ void Entry::cachePinnedIndex(FilterId filterId, int index) {
|
|||
}
|
||||
if (!index) {
|
||||
_pinnedIndex.erase(i);
|
||||
pinnedIndexChanged(was, index);
|
||||
} else if (!was) {
|
||||
_pinnedIndex.emplace(filterId, index);
|
||||
} else {
|
||||
if (!was) {
|
||||
_pinnedIndex.emplace(filterId, index);
|
||||
} else {
|
||||
i->second = index;
|
||||
}
|
||||
pinnedIndexChanged(was, index);
|
||||
i->second = index;
|
||||
}
|
||||
pinnedIndexChanged(filterId, was, index);
|
||||
}
|
||||
|
||||
void Entry::cacheTopPromoted(bool promoted) {
|
||||
|
|
|
@ -205,7 +205,7 @@ protected:
|
|||
|
||||
private:
|
||||
virtual void changedChatListPinHook();
|
||||
void pinnedIndexChanged(int was, int now);
|
||||
void pinnedIndexChanged(FilterId filterId, int was, int now);
|
||||
[[nodiscard]] uint64 computeSortPosition(FilterId filterId) const;
|
||||
|
||||
void setChatListExistence(bool exists);
|
||||
|
|
Loading…
Add table
Reference in a new issue