mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
Merge branch 'soru/play-audio' into 'main'
fix: encrypted files Closes #518 and #535 See merge request famedly/fluffychat!506
This commit is contained in:
commit
328a61c288
@ -87,9 +87,9 @@ extension LocalizedBody on Event {
|
||||
|
||||
Future<MatrixFile> downloadAndDecryptAttachmentCached(
|
||||
{bool getThumbnail = false}) async {
|
||||
final mxcUrl = attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail);
|
||||
_downloadAndDecryptFutures[mxcUrl.toString()] ??=
|
||||
downloadAndDecryptAttachment(
|
||||
final mxcUrl =
|
||||
attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail).toString();
|
||||
_downloadAndDecryptFutures[mxcUrl] ??= downloadAndDecryptAttachment(
|
||||
getThumbnail: getThumbnail,
|
||||
downloadCallback: (Uri url) async {
|
||||
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);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
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.attachmentMxcUrl;
|
||||
final key = isOriginal
|
||||
? widget.event.attachmentMxcUrl
|
||||
: widget.event.thumbnailMxcUrl;
|
||||
? widget.event.attachmentMxcUrl.toString()
|
||||
: widget.event.thumbnailMxcUrl.toString();
|
||||
final mimetype = getMimetype(!isOriginal);
|
||||
if (_contentRenderers.containsKey(mimetype)) {
|
||||
return _contentRenderers[mimetype]
|
||||
.memory(_displayFile.bytes, key.toString());
|
||||
return _contentRenderers[mimetype].memory(_displayFile.bytes, key);
|
||||
} else {
|
||||
return Image.memory(
|
||||
_displayFile.bytes,
|
||||
|
Loading…
Reference in New Issue
Block a user