diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index 738377b58..7e92caa1d 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -1325,11 +1325,6 @@ void RepliesWidget::refreshJoinGroupButton() { } } -void RepliesWidget::sendExistingDocument( - not_null document) { - sendExistingDocument(document, {}, std::nullopt); -} - bool RepliesWidget::sendExistingDocument( not_null document, Api::SendOptions options, diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.h b/Telegram/SourceFiles/history/view/history_view_replies_section.h index c8bacc2c7..b7c8cc164 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.h +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.h @@ -301,7 +301,6 @@ private: Api::SendOptions options, bool ctrlShiftEnter); - void sendExistingDocument(not_null document); bool sendExistingDocument( not_null document, Api::SendOptions options, diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index 07ce6a82d..be744824a 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -340,7 +340,12 @@ void ScheduledWidget::setupComposeControls() { _composeControls->fileChosen( ) | rpl::start_with_next([=](ChatHelpers::FileChosen data) { controller()->hideLayer(anim::type::normal); - sendExistingDocument(data.document); + const auto document = data.document; + const auto callback = crl::guard(this, [=](Api::SendOptions options) { + sendExistingDocument(document, options); + }); + controller()->show( + PrepareScheduleBox(this, _show, sendMenuDetails(), callback)); }, lifetime()); _composeControls->photoChosen( @@ -808,15 +813,6 @@ void ScheduledWidget::edit( _composeControls->focus(); } -void ScheduledWidget::sendExistingDocument( - not_null document) { - const auto callback = [=](Api::SendOptions options) { - sendExistingDocument(document, options); - }; - controller()->show( - PrepareScheduleBox(this, _show, sendMenuDetails(), callback)); -} - bool ScheduledWidget::sendExistingDocument( not_null document, Api::SendOptions options) { diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.h b/Telegram/SourceFiles/history/view/history_view_scheduled_section.h index ba4813713..519a45dfb 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.h +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.h @@ -251,7 +251,6 @@ private: Api::SendOptions options, bool ctrlShiftEnter); - void sendExistingDocument(not_null document); bool sendExistingDocument( not_null document, Api::SendOptions options); diff --git a/Telegram/SourceFiles/media/stories/media_stories_reply.h b/Telegram/SourceFiles/media/stories/media_stories_reply.h index 3e4ff217b..445557692 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_reply.h +++ b/Telegram/SourceFiles/media/stories/media_stories_reply.h @@ -118,7 +118,6 @@ private: bool ctrlShiftEnter); void finishSending(bool skipToast = false); - void sendExistingDocument(not_null document); bool sendExistingDocument( not_null document, Api::SendOptions options, diff --git a/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp b/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp index 5594e6c4c..68e4b8cc1 100644 --- a/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp +++ b/Telegram/SourceFiles/settings/business/settings_shortcut_messages.cpp @@ -214,7 +214,6 @@ private: Api::SendOptions options, bool ctrlShiftEnter); - void sendExistingDocument(not_null document); bool sendExistingDocument( not_null document, Api::SendOptions options, @@ -696,7 +695,7 @@ void ShortcutMessages::setupComposeControls() { _composeControls->fileChosen( ) | rpl::start_with_next([=](ChatHelpers::FileChosen data) { _controller->hideLayer(anim::type::normal); - sendExistingDocument(data.document); + sendExistingDocument(data.document, {}, std::nullopt); }, lifetime()); _composeControls->photoChosen( @@ -1494,11 +1493,6 @@ void ShortcutMessages::doSetInnerFocus() { } } -void ShortcutMessages::sendExistingDocument( - not_null document) { - sendExistingDocument(document, {}, std::nullopt); -} - bool ShortcutMessages::sendExistingDocument( not_null document, Api::SendOptions options,