Read chats only on sending (support).

This commit is contained in:
John Preston 2018-09-28 14:56:21 +03:00
parent 1c79f85d00
commit 20e303d3e6
5 changed files with 21 additions and 5 deletions

View file

@ -391,4 +391,9 @@ void AuthSession::checkAutoLockIn(TimeMs time) {
_autoLockTimer.callOnce(time);
}
bool AuthSession::supportMode() const {
// return true; AssertIsDebug();
return false;
}
AuthSession::~AuthSession() = default;

View file

@ -262,6 +262,8 @@ public:
base::Observable<DocumentData*> documentUpdated;
base::Observable<std::pair<not_null<HistoryItem*>, MsgId>> messageIdChanging;
bool supportMode() const;
~AuthSession();
private:

View file

@ -2898,7 +2898,9 @@ void HistoryWidget::historyDownClicked() {
} else if (_replyReturn && _replyReturn->history() == _migrated) {
showHistory(_peer->id, -_replyReturn->id);
} else if (_peer) {
showHistory(_peer->id, ShowAtUnreadMsgId);
showHistory(
_peer->id,
Auth().supportMode() ? ShowAtTheEndMsgId : ShowAtUnreadMsgId);
}
}

View file

@ -4002,7 +4002,10 @@ bool MainWidget::isActive() const {
}
bool MainWidget::doWeReadServerHistory() const {
return isActive() && !_mainSection && _history->doWeReadServerHistory();
return isActive()
&& !Auth().supportMode()
&& !_mainSection
&& _history->doWeReadServerHistory();
}
bool MainWidget::doWeReadMentions() const {

View file

@ -416,16 +416,20 @@ void MainWindow::themeUpdated(const Window::Theme::BackgroundUpdate &data) {
bool MainWindow::doWeReadServerHistory() {
updateIsActive(0);
return isActive() && _main && !Ui::isLayerShown() && _main->doWeReadServerHistory();
return isActive()
&& !Ui::isLayerShown()
&& (_main ? _main->doWeReadServerHistory() : false);
}
bool MainWindow::doWeReadMentions() {
updateIsActive(0);
return isActive() && _main && !Ui::isLayerShown() && _main->doWeReadMentions();
return isActive()
&& !Ui::isLayerShown()
&& (_main ? _main->doWeReadMentions() : false);
}
void MainWindow::checkHistoryActivation() {
if (_main && doWeReadServerHistory()) {
if (doWeReadServerHistory()) {
_main->markActiveHistoryAsRead();
}
}