mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Clear fake-unread status when switching folders.
This commit is contained in:
@@ -242,6 +242,9 @@ bool SessionController::uniqueChatsInSearchResults() const {
|
||||
}
|
||||
|
||||
void SessionController::openFolder(not_null<Data::Folder*> folder) {
|
||||
if (_openedFolder.current() != folder) {
|
||||
resetFakeUnreadWhileOpened();
|
||||
}
|
||||
setActiveChatsFilter(0);
|
||||
_openedFolder = folder.get();
|
||||
}
|
||||
@@ -269,6 +272,12 @@ void SessionController::setActiveChatEntry(Dialogs::RowDescriptor row) {
|
||||
}
|
||||
}
|
||||
|
||||
void SessionController::resetFakeUnreadWhileOpened() {
|
||||
if (const auto history = _activeChatEntry.current().key.history()) {
|
||||
history->setFakeUnreadWhileOpened(false);
|
||||
}
|
||||
}
|
||||
|
||||
bool SessionController::chatEntryHistoryMove(int steps) {
|
||||
if (_chatEntryHistory.empty()) {
|
||||
return false;
|
||||
@@ -781,6 +790,9 @@ FilterId SessionController::activeChatsFilterCurrent() const {
|
||||
}
|
||||
|
||||
void SessionController::setActiveChatsFilter(FilterId id) {
|
||||
if (activeChatsFilterCurrent() != id) {
|
||||
resetFakeUnreadWhileOpened();
|
||||
}
|
||||
_activeChatsFilter.force_assign(id);
|
||||
if (id) {
|
||||
closeFolder();
|
||||
|
Reference in New Issue
Block a user