Pass FilterId to pinnedIndexChanged.

This commit is contained in:
John Preston 2021-12-02 11:51:54 +04:00
parent 894e7c5828
commit c4c234f0d3
2 changed files with 7 additions and 10 deletions

View File

@ -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) {

View File

@ -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);