2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 07:25:46 +00:00

Support drafts in monoforum sublists.

This commit is contained in:
John Preston
2025-05-20 20:32:24 +04:00
parent b2c01991a6
commit f65556acb7
30 changed files with 488 additions and 208 deletions

View File

@@ -557,6 +557,7 @@ bool MainWidget::setForwardDraft(
const auto history = thread->owningHistory();
const auto items = session().data().idsToItems(draft.ids);
const auto topicRootId = thread->topicRootId();
const auto monoforumPeerId = thread->monoforumPeerId();
const auto error = GetErrorForSending(
history->peer,
{
@@ -569,7 +570,7 @@ bool MainWidget::setForwardDraft(
return false;
}
history->setForwardDraft(topicRootId, std::move(draft));
history->setForwardDraft(topicRootId, monoforumPeerId, std::move(draft));
_controller->showThread(
thread,
ShowAtUnreadMsgId,
@@ -596,12 +597,16 @@ bool MainWidget::shareUrl(
};
const auto history = thread->owningHistory();
const auto topicRootId = thread->topicRootId();
const auto monoforumPeerId = thread->monoforumPeerId();
history->setLocalDraft(std::make_unique<Data::Draft>(
textWithTags,
FullReplyTo{ .topicRootId = topicRootId },
FullReplyTo{
.topicRootId = topicRootId,
.monoforumPeerId = monoforumPeerId,
},
cursor,
Data::WebPageDraft()));
history->clearLocalEditDraft(topicRootId);
history->clearLocalEditDraft(topicRootId, monoforumPeerId);
history->session().changes().entryUpdated(
thread,
Data::EntryUpdate::Flag::LocalDraftSet);
@@ -2044,6 +2049,8 @@ bool MainWidget::showBackFromStack(const SectionShow &params) {
});
return (_dialogs != nullptr);
}
session().api().saveCurrentDraftToCloud();
auto item = std::move(_stack.back());
_stack.pop_back();
if (const auto currentHistoryPeer = _history->peer()) {