mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +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:
@@ -1091,13 +1091,13 @@ void SendFilesBox::captionResized() {
|
||||
}
|
||||
|
||||
bool SendFilesBox::canAddFiles(not_null<const QMimeData*> data) const {
|
||||
return CanAddUrls(base::GetMimeUrls(data)) || data->hasImage();
|
||||
return data->hasImage() || CanAddUrls(Core::ReadMimeUrls(data));
|
||||
}
|
||||
|
||||
bool SendFilesBox::addFiles(not_null<const QMimeData*> data) {
|
||||
const auto premium = _controller->session().premium();
|
||||
auto list = [&] {
|
||||
const auto urls = base::GetMimeUrls(data);
|
||||
const auto urls = Core::ReadMimeUrls(data);
|
||||
auto result = CanAddUrls(urls)
|
||||
? Storage::PrepareMediaList(
|
||||
urls,
|
||||
|
Reference in New Issue
Block a user