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

Received messages are not marked as read while scroll is at the top.

HistoryToEnd button is always shown if there are unread messages.
HistoryToEnd button displayes unread messages count.
New service message (HistoryCleared) is handled (not displayed at all).
This commit is contained in:
John Preston
2016-06-03 15:45:33 +03:00
parent 7f353d9b1a
commit 958e47cc19
20 changed files with 359 additions and 165 deletions

View File

@@ -904,13 +904,13 @@ void MainWindow::hideConnecting() {
if (settings) settings->update();
}
bool MainWindow::historyIsActive() const {
return isActive(false) && main && main->historyIsActive() && (!settings || !settings->isVisible());
bool MainWindow::doWeReadServerHistory() const {
return isActive(false) && main && (!settings || !settings->isVisible()) && main->doWeReadServerHistory();
}
void MainWindow::checkHistoryActivation() {
if (main && MTP::authedId() && historyIsActive()) {
main->historyWasRead();
if (main && MTP::authedId() && doWeReadServerHistory()) {
main->markActiveHistoryAsRead();
}
QTimer::singleShot(1, this, SLOT(updateTrayMenu()));
}