mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-23 20:49:26 +01:00
Merge branch 'krille/image-sending' into 'main'
feat: Better image sending experience See merge request famedly/fluffychat!796
This commit is contained in:
commit
6a39defbfe
@ -414,10 +414,10 @@ class ChatController extends State<Chat> {
|
||||
bytes: audioFile.readAsBytesSync(),
|
||||
name: audioFile.path,
|
||||
);
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () =>
|
||||
room!.sendFileEvent(file, inReplyTo: replyEvent, extraContent: {
|
||||
await room!.sendFileEvent(
|
||||
file,
|
||||
inReplyTo: replyEvent,
|
||||
extraContent: {
|
||||
'info': {
|
||||
...file.info,
|
||||
'duration': result.duration,
|
||||
@ -427,7 +427,7 @@ class ChatController extends State<Chat> {
|
||||
'duration': result.duration,
|
||||
'waveform': result.waveform,
|
||||
},
|
||||
}),
|
||||
},
|
||||
);
|
||||
setState(() {
|
||||
replyEvent = null;
|
||||
|
@ -290,6 +290,8 @@ class Message extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
row,
|
||||
if (event.fileSendingStatus != null)
|
||||
Text(event.fileSendingStatus!.name),
|
||||
if (event.hasAggregatedEvents(timeline, RelationshipTypes.reaction))
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
|
@ -31,20 +31,16 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
||||
Future<void> _send() async {
|
||||
var file = widget.file;
|
||||
MatrixImageFile? thumbnail;
|
||||
if (file is MatrixImageFile &&
|
||||
!origImage &&
|
||||
file.bytes.length > minSizeToCompress) {
|
||||
file = await MatrixImageFile.shrink(
|
||||
bytes: file.bytes,
|
||||
name: file.name,
|
||||
compute: widget.room.client.runInBackground,
|
||||
);
|
||||
}
|
||||
if (file is MatrixVideoFile && file.bytes.length > minSizeToCompress) {
|
||||
file = await file.resizeVideo();
|
||||
thumbnail = await file.getVideoThumbnail();
|
||||
}
|
||||
await widget.room.sendFileEvent(file, thumbnail: thumbnail);
|
||||
widget.room.sendFileEvent(
|
||||
file,
|
||||
thumbnail: thumbnail,
|
||||
shrinkImageMaxDimension: origImage ? null : 1600,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -76,7 +76,8 @@ extension LocalizedBody on Event {
|
||||
Future<MatrixFile?> downloadAndDecryptAttachmentCached(
|
||||
{bool getThumbnail = false}) async {
|
||||
final mxcUrl =
|
||||
attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail).toString();
|
||||
attachmentOrThumbnailMxcUrl(getThumbnail: getThumbnail)?.toString() ??
|
||||
eventId;
|
||||
_downloadAndDecryptFutures[mxcUrl] ??= downloadAndDecryptAttachment(
|
||||
getThumbnail: getThumbnail,
|
||||
downloadCallback: (Uri url) async {
|
||||
|
@ -976,7 +976,7 @@ packages:
|
||||
name: matrix
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.8.14"
|
||||
version: "0.8.15"
|
||||
matrix_api_lite:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -57,7 +57,7 @@ dependencies:
|
||||
keyboard_shortcuts: ^0.1.4
|
||||
localstorage: ^4.0.0+1
|
||||
lottie: ^1.2.2
|
||||
matrix: ^0.8.14
|
||||
matrix: ^0.8.15
|
||||
matrix_link_text: ^1.0.2
|
||||
open_noti_settings: ^0.4.0
|
||||
package_info_plus: ^1.3.0
|
||||
|
Loading…
Reference in New Issue
Block a user