Don't apply entry from dialogs if postponed.

This commit is contained in:
John Preston 2020-02-23 12:56:33 +04:00
parent f7144a55e2
commit a84c7e0b06

View File

@ -297,6 +297,10 @@ void Histories::sendDialogRequests() {
}
void Histories::dialogEntryApplied(not_null<History*> history) {
const auto state = lookup(history);
if (state->postponedRequestEntry) {
return;
}
history->dialogEntryApplied();
if (const auto callbacks = _dialogRequestsPending.take(history)) {
for (const auto &callback : *callbacks) {
@ -308,11 +312,9 @@ void Histories::dialogEntryApplied(not_null<History*> history) {
callback();
}
}
if (const auto state = lookup(history)) {
if (state->sentReadTill && state->sentReadDone) {
history->setInboxReadTill(base::take(state->sentReadTill));
checkEmptyState(history);
}
if (state && state->sentReadTill && state->sentReadDone) {
history->setInboxReadTill(base::take(state->sentReadTill));
checkEmptyState(history);
}
}