mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Set preview as cancelled if no preview in editing message.
This commit is contained in:
@@ -1327,7 +1327,7 @@ void HistoryWidget::fieldChanged() {
|
||||
}
|
||||
|
||||
updateSendButtonType();
|
||||
if (showRecordButton()) {
|
||||
if (!HasSendText(_field)) {
|
||||
_previewCancelled = false;
|
||||
}
|
||||
if (updateCmdStartShown()) {
|
||||
@@ -5682,19 +5682,23 @@ void HistoryWidget::editMessage(not_null<HistoryItem*> item) {
|
||||
editData.text.size(),
|
||||
QFIXED_MAX
|
||||
};
|
||||
const auto previewPage = [&]() -> WebPageData* {
|
||||
if (const auto media = item->media()) {
|
||||
return media->webpage();
|
||||
}
|
||||
return nullptr;
|
||||
}();
|
||||
const auto previewCancelled = !previewPage;
|
||||
_history->setLocalEditDraft(std::make_unique<Data::Draft>(
|
||||
editData,
|
||||
item->id,
|
||||
cursor,
|
||||
false));
|
||||
previewCancelled));
|
||||
applyDraft();
|
||||
|
||||
_previewData = nullptr;
|
||||
if (const auto media = item->media()) {
|
||||
if (const auto page = media->webpage()) {
|
||||
_previewData = page;
|
||||
updatePreview();
|
||||
}
|
||||
_previewData = previewPage;
|
||||
if (_previewData) {
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
updateBotKeyboard();
|
||||
|
Reference in New Issue
Block a user