fix: encrypted files
This commit is contained in:
parent
161791a07d
commit
3a9400f638
|
@ -87,9 +87,9 @@ extension LocalizedBody on Event {
|
||||||
|
|
||||||
Future<MatrixFile> downloadAndDecryptAttachmentCached(
|
Future<MatrixFile> downloadAndDecryptAttachmentCached(
|
||||||
{bool getThumbnail = false}) async {
|
{bool getThumbnail = false}) async {
|
||||||
final mxcUrl = attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail);
|
final mxcUrl =
|
||||||
_downloadAndDecryptFutures[mxcUrl.toString()] ??=
|
attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail).toString();
|
||||||
downloadAndDecryptAttachment(
|
_downloadAndDecryptFutures[mxcUrl] ??= downloadAndDecryptAttachment(
|
||||||
getThumbnail: getThumbnail,
|
getThumbnail: getThumbnail,
|
||||||
downloadCallback: (Uri url) async {
|
downloadCallback: (Uri url) async {
|
||||||
final file = await DefaultCacheManager().getSingleFile(url.toString());
|
final file = await DefaultCacheManager().getSingleFile(url.toString());
|
||||||
|
|
|
@ -76,7 +76,7 @@ class _AudioPlayerState extends State<AudioPlayerWidget> {
|
||||||
Logs().v('Could not download audio file', e, s);
|
Logs().v('Could not download audio file', e, s);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(e.toLocalizedString(context)),
|
content: Text(e.toString()),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,12 +261,11 @@ class _ImageBubbleState extends State<ImageBubble> {
|
||||||
widget.event.attachmentOrThumbnailMxcUrl(getThumbnail: true) ==
|
widget.event.attachmentOrThumbnailMxcUrl(getThumbnail: true) ==
|
||||||
widget.event.attachmentMxcUrl;
|
widget.event.attachmentMxcUrl;
|
||||||
final key = isOriginal
|
final key = isOriginal
|
||||||
? widget.event.attachmentMxcUrl
|
? widget.event.attachmentMxcUrl.toString()
|
||||||
: widget.event.thumbnailMxcUrl;
|
: widget.event.thumbnailMxcUrl.toString();
|
||||||
final mimetype = getMimetype(!isOriginal);
|
final mimetype = getMimetype(!isOriginal);
|
||||||
if (_contentRenderers.containsKey(mimetype)) {
|
if (_contentRenderers.containsKey(mimetype)) {
|
||||||
return _contentRenderers[mimetype]
|
return _contentRenderers[mimetype].memory(_displayFile.bytes, key);
|
||||||
.memory(_displayFile.bytes, key.toString());
|
|
||||||
} else {
|
} else {
|
||||||
return Image.memory(
|
return Image.memory(
|
||||||
_displayFile.bytes,
|
_displayFile.bytes,
|
||||||
|
|
Loading…
Reference in New Issue