mirror of https://github.com/procxx/kepka.git
Clear fake-unread status when switching folders.
This commit is contained in:
parent
c7878f9d21
commit
f4f6550d66
|
@ -242,6 +242,9 @@ bool SessionController::uniqueChatsInSearchResults() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionController::openFolder(not_null<Data::Folder*> folder) {
|
void SessionController::openFolder(not_null<Data::Folder*> folder) {
|
||||||
|
if (_openedFolder.current() != folder) {
|
||||||
|
resetFakeUnreadWhileOpened();
|
||||||
|
}
|
||||||
setActiveChatsFilter(0);
|
setActiveChatsFilter(0);
|
||||||
_openedFolder = folder.get();
|
_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) {
|
bool SessionController::chatEntryHistoryMove(int steps) {
|
||||||
if (_chatEntryHistory.empty()) {
|
if (_chatEntryHistory.empty()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -781,6 +790,9 @@ FilterId SessionController::activeChatsFilterCurrent() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionController::setActiveChatsFilter(FilterId id) {
|
void SessionController::setActiveChatsFilter(FilterId id) {
|
||||||
|
if (activeChatsFilterCurrent() != id) {
|
||||||
|
resetFakeUnreadWhileOpened();
|
||||||
|
}
|
||||||
_activeChatsFilter.force_assign(id);
|
_activeChatsFilter.force_assign(id);
|
||||||
if (id) {
|
if (id) {
|
||||||
closeFolder();
|
closeFolder();
|
||||||
|
|
|
@ -328,6 +328,7 @@ private:
|
||||||
|
|
||||||
void pushToChatEntryHistory(Dialogs::RowDescriptor row);
|
void pushToChatEntryHistory(Dialogs::RowDescriptor row);
|
||||||
bool chatEntryHistoryMove(int steps);
|
bool chatEntryHistoryMove(int steps);
|
||||||
|
void resetFakeUnreadWhileOpened();
|
||||||
|
|
||||||
const not_null<Controller*> _window;
|
const not_null<Controller*> _window;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue