2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Save local drafts in scheduled / replies sections.

Fix inline bot switch inline in scheduled / replies sections.
This commit is contained in:
John Preston
2020-11-13 20:27:08 +03:00
parent 4a0efb9114
commit b3eb7858e6
15 changed files with 1025 additions and 390 deletions

View File

@@ -2441,16 +2441,14 @@ void ApiWrap::saveCurrentDraftToCloud() {
Core::App().saveCurrentDraftsToHistories();
for (const auto controller : _session->windows()) {
if (const auto peer = controller->activeChatCurrent().peer()) {
if (const auto history = _session->data().historyLoaded(peer)) {
_session->local().writeDrafts(history);
if (const auto history = controller->activeChatCurrent().history()) {
_session->local().writeDrafts(history);
const auto localDraft = history->localDraft();
const auto cloudDraft = history->cloudDraft();
if (!Data::draftsAreEqual(localDraft, cloudDraft)
&& !_session->supportMode()) {
saveDraftToCloudDelayed(history);
}
const auto localDraft = history->localDraft();
const auto cloudDraft = history->cloudDraft();
if (!Data::draftsAreEqual(localDraft, cloudDraft)
&& !_session->supportMode()) {
saveDraftToCloudDelayed(history);
}
}
}