MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / setForwardDraft

Method setForwardDraft

Telegram/SourceFiles/mainwidget.cpp:580–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580bool MainWidget::setForwardDraft(
581 not_null<Data::Thread*> thread,
582 Data::ForwardDraft &&draft) {
583 const auto history = thread->owningHistory();
584 const auto items = session().data().idsToItems(draft.ids);
585 const auto topicRootId = thread->topicRootId();
586 const auto monoforumPeerId = thread->monoforumPeerId();
587 const auto error = GetErrorForSending(
588 history->peer,
589 {
590 .topicRootId = topicRootId,
591 .forward = &items,
592 .ignoreSlowmodeCountdown = true,
593 });
594 if (error) {
595 Data::ShowSendErrorToast(_controller, history->peer, error);
596 return false;
597 }
598
599 history->setForwardDraft(topicRootId, monoforumPeerId, std::move(draft));
600 _controller->showThread(
601 thread,
602 ShowAtUnreadMsgId,
603 SectionShow::Way::Forward);
604 return true;
605}
606
607bool MainWidget::shareUrl(
608 not_null<Data::Thread*> thread,

Callers 1

finishForwardingMethod · 0.45

Calls 8

GetErrorForSendingFunction · 0.85
ShowSendErrorToastFunction · 0.85
idsToItemsMethod · 0.80
showThreadMethod · 0.80
owningHistoryMethod · 0.45
dataMethod · 0.45
topicRootIdMethod · 0.45
monoforumPeerIdMethod · 0.45

Tested by

no test coverage detected