2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-08 02:15:56 +00:00

Improve editing messages with webpage previews.

This commit is contained in:
John Preston
2023-10-26 10:26:06 +04:00
parent c035ec6917
commit 3b91e2dee4
7 changed files with 54 additions and 21 deletions

View File

@@ -68,7 +68,7 @@ mtpRequestId EditMessage(
const auto emptyFlag = MTPmessages_EditMessage::Flag(0);
const auto flags = emptyFlag
| (!text.isEmpty() || media
| ((!text.isEmpty() || media)
? MTPmessages_EditMessage::Flag::f_message
: emptyFlag)
| ((media && inputMedia.has_value())
@@ -98,7 +98,7 @@ mtpRequestId EditMessage(
item->history()->peer->input,
MTP_int(id),
MTP_string(text),
inputMedia.value_or(Data::WebPageForMTP(webpage)),
inputMedia.value_or(Data::WebPageForMTP(webpage, text.isEmpty())),
MTPReplyMarkup(),
sentEntities,
MTP_int(options.scheduled)