mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
Read chats only on sending (support).
This commit is contained in:
parent
1c79f85d00
commit
20e303d3e6
5 changed files with 21 additions and 5 deletions
|
@ -391,4 +391,9 @@ void AuthSession::checkAutoLockIn(TimeMs time) {
|
|||
_autoLockTimer.callOnce(time);
|
||||
}
|
||||
|
||||
bool AuthSession::supportMode() const {
|
||||
// return true; AssertIsDebug();
|
||||
return false;
|
||||
}
|
||||
|
||||
AuthSession::~AuthSession() = default;
|
||||
|
|
|
@ -262,6 +262,8 @@ public:
|
|||
base::Observable<DocumentData*> documentUpdated;
|
||||
base::Observable<std::pair<not_null<HistoryItem*>, MsgId>> messageIdChanging;
|
||||
|
||||
bool supportMode() const;
|
||||
|
||||
~AuthSession();
|
||||
|
||||
private:
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue