| 578 | } |
| 579 | |
| 580 | bool 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 | |
| 607 | bool MainWidget::shareUrl( |
| 608 | not_null<Data::Thread*> thread, |
no test coverage detected