diff --git a/Telegram/SourceFiles/api/api_common.h b/Telegram/SourceFiles/api/api_common.h index 00154cf01..9503d8b29 100644 --- a/Telegram/SourceFiles/api/api_common.h +++ b/Telegram/SourceFiles/api/api_common.h @@ -28,7 +28,7 @@ struct SendAction { not_null history; SendOptions options; MsgId replyTo = 0; - bool clearDraft = false; + bool clearDraft = true; bool generateLocal = true; }; diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index c7d4fcb19..d15de0a8b 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -114,6 +114,7 @@ void activateBotCommand( Ui::show(Box(tr::lng_bot_share_phone(tr::now), tr::lng_bot_share_phone_confirm(tr::now), [=] { Ui::showPeerHistory(history, ShowAtTheEndMsgId); auto action = Api::SendAction(history); + action.clearDraft = false; action.replyTo = msgId; history->session().api().shareContact( history->session().user(), diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 29c101e7d..e8f2ad131 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5547,7 +5547,6 @@ void HistoryWidget::sendInlineResult( } auto action = Api::SendAction(_history); - action.clearDraft = true; action.replyTo = replyToId(); action.generateLocal = true; session().api().sendInlineResult(bot, result, action); diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index f4221c471..ff6541be6 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -512,7 +512,6 @@ void ScheduledWidget::sendInlineResult( not_null bot, Api::SendOptions options) { auto action = Api::SendAction(_history); - action.clearDraft = true; //action.replyTo = replyToId(); action.options = options; action.generateLocal = true; diff --git a/Telegram/SourceFiles/support/support_helper.cpp b/Telegram/SourceFiles/support/support_helper.cpp index 142d4c590..fe5cce24a 100644 --- a/Telegram/SourceFiles/support/support_helper.cpp +++ b/Telegram/SourceFiles/support/support_helper.cpp @@ -604,7 +604,7 @@ QString InterpretSendPath(const QString &path) { return "App Error: Could not find channel with id: " + QString::number(peerToChannel(toId)); } Ui::showPeerHistory(history, ShowAtUnreadMsgId); - Auth().api().sendFiles( + history->session().api().sendFiles( Storage::PrepareMediaList(QStringList(filePath), st::sendMediaPreviewSize), SendMediaType::File, { caption }, diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 1e636ac52..7e9e3e82f 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -669,6 +669,7 @@ void PeerMenuShareContactBox( return; } else if (peer->isSelf()) { auto action = Api::SendAction(peer->owner().history(peer)); + action.clearDraft = false; user->session().api().shareContact(user, action); Ui::Toast::Show(tr::lng_share_done(tr::now)); if (auto strong = *weak) { @@ -686,6 +687,7 @@ void PeerMenuShareContactBox( const auto history = peer->owner().history(peer); Ui::showPeerHistory(history, ShowAtTheEndMsgId); auto action = Api::SendAction(history); + action.clearDraft = false; user->session().api().shareContact(user, action); }), LayerOption::KeepOther); }; @@ -711,6 +713,7 @@ void PeerMenuCreatePoll(not_null peer) { return; } auto action = Api::SendAction(peer->owner().history(peer)); + action.clearDraft = false; action.options = result.options; if (const auto id = App::main()->currentReplyToIdFor(action.history)) { action.replyTo = id; @@ -827,6 +830,7 @@ QPointer ShowForwardMessagesBox( if (!items.empty()) { const auto api = &peer->session().api(); auto action = Api::SendAction(peer->owner().history(peer)); + action.clearDraft = false; action.generateLocal = false; api->forwardMessages(std::move(items), action, [] { Ui::Toast::Show(tr::lng_share_done(tr::now));