fix: incorrect filename when caption is used in body of event

This commit is contained in:
Karthikeyan S 2025-03-12 08:21:01 +05:30
parent 84c12ff143
commit 27c8e43dca
No known key found for this signature in database
GPG Key ID: 28BA6AEE539ECE2E
1 changed files with 3 additions and 1 deletions

View File

@ -792,9 +792,11 @@ class Event extends MatrixEvent {
throw ('Unable to decrypt file'); throw ('Unable to decrypt file');
} }
} }
final filename = content.tryGet<String>('filename') ?? body;
return MatrixFile( return MatrixFile(
bytes: uint8list, bytes: uint8list,
name: body, name: filename,
mimeType: attachmentMimetype, mimeType: attachmentMimetype,
); );
} }