mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 01:10:13 +00:00
Fix draft clearing on message send.
Regression was introduced in caef7dde24
.
This commit is contained in:
parent
f199205592
commit
5758f756c9
@ -28,7 +28,7 @@ struct SendAction {
|
||||
not_null<History*> history;
|
||||
SendOptions options;
|
||||
MsgId replyTo = 0;
|
||||
bool clearDraft = false;
|
||||
bool clearDraft = true;
|
||||
bool generateLocal = true;
|
||||
};
|
||||
|
||||
|
@ -114,6 +114,7 @@ void activateBotCommand(
|
||||
Ui::show(Box<ConfirmBox>(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(),
|
||||
|
@ -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);
|
||||
|
@ -512,7 +512,6 @@ void ScheduledWidget::sendInlineResult(
|
||||
not_null<UserData*> bot,
|
||||
Api::SendOptions options) {
|
||||
auto action = Api::SendAction(_history);
|
||||
action.clearDraft = true;
|
||||
//action.replyTo = replyToId();
|
||||
action.options = options;
|
||||
action.generateLocal = true;
|
||||
|
@ -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 },
|
||||
|
@ -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<PeerData*> 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<Ui::RpWidget> 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));
|
||||
|
Loading…
Reference in New Issue
Block a user