2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Implement forwarding to topics.

This commit is contained in:
John Preston
2022-11-01 08:46:31 +04:00
parent c497e9ca9c
commit 1ac051a812
38 changed files with 1413 additions and 561 deletions

View File

@@ -3049,7 +3049,7 @@ void ApiWrap::sendAction(const SendAction &action) {
void ApiWrap::finishForwarding(const SendAction &action) {
const auto history = action.history;
auto toForward = history->resolveForwardDraft();
auto toForward = history->resolveForwardDraft(action.topicRootId);
if (!toForward.items.empty()) {
const auto error = GetErrorTextForSending(
history->peer,
@@ -3062,7 +3062,7 @@ void ApiWrap::finishForwarding(const SendAction &action) {
}
forwardMessages(std::move(toForward), action);
_session->data().cancelForwarding(history);
history->setForwardDraft(action.topicRootId, {});
}
_session->data().sendHistoryChangeNotifications();
@@ -3199,7 +3199,8 @@ void ApiWrap::forwardMessages(
HistoryItem::NewMessageDate(action.options.scheduled),
messageFromId,
messagePostAuthor,
item); // #TODO forum forward
item,
action.topicRootId); // #TODO forum forward
_session->data().registerMessageRandomId(randomId, newId);
if (!localIds) {
localIds = std::make_shared<base::flat_map<uint64, FullMsgId>>();