From 751dcb760078623f8b608d56230d3f4b3e6fa5a4 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Mon, 5 Oct 2020 16:41:29 +0200 Subject: [PATCH] fix: send images as images, not files --- lib/views/chat.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/views/chat.dart b/lib/views/chat.dart index 1bd701b..acaf76d 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -227,7 +227,7 @@ class _ChatState extends State<_Chat> { } void sendImageAction(BuildContext context) async { - MatrixFile file; + MatrixImageFile file; if (PlatformInfos.isMobile) { final result = await ImagePicker().getImage( source: ImageSource.gallery, @@ -235,7 +235,7 @@ class _ChatState extends State<_Chat> { maxWidth: 1600, maxHeight: 1600); if (result == null) return; - file = MatrixFile( + file = MatrixImageFile( bytes: await result.readAsBytes(), name: result.path, ); @@ -243,7 +243,7 @@ class _ChatState extends State<_Chat> { final result = await FilePickerCross.importFromStorage(type: FileTypeCross.image); if (result == null) return; - file = MatrixFile( + file = MatrixImageFile( bytes: result.toUint8List(), name: result.fileName, );