mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-03 07:56:03 +00:00
Fix pasting images from Firefox on Windows.
Fixes #10564. Together with the image data Firefox sets to the clipboard an URLs list which has a path to local temp file, created from that image. Reading images from disk is slower + sometimes the content of the file is wrong so for this case we prefer to read the image data directly.
This commit is contained in:
@@ -69,10 +69,10 @@ namespace {
|
||||
|
||||
auto ListFromMimeData(not_null<const QMimeData*> data, bool premium) {
|
||||
using Error = Ui::PreparedList::Error;
|
||||
auto result = data->hasUrls()
|
||||
const auto list = Core::ReadMimeUrls(data);
|
||||
auto result = !list.isEmpty()
|
||||
? Storage::PrepareMediaList(
|
||||
// When we edit media, we need only 1 file.
|
||||
base::GetMimeUrls(data).mid(0, 1),
|
||||
list.mid(0, 1), // When we edit media, we need only 1 file.
|
||||
st::sendMediaPreviewSize,
|
||||
premium)
|
||||
: Ui::PreparedList(Error::EmptyFile, QString());
|
||||
|
Reference in New Issue
Block a user