|
|
|
@ -626,10 +626,19 @@ class ChatController extends State<ChatPageWithRoom>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if (result == null) return;
|
|
|
|
if (result == null) return;
|
|
|
|
final audioFile = XFile(result.path);
|
|
|
|
final audioFile = XFile(result.path);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final bytesResult = await showFutureLoadingDialog(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
future: audioFile.readAsBytes,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
final bytes = bytesResult.result;
|
|
|
|
|
|
|
|
if (bytes == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
final file = MatrixAudioFile(
|
|
|
|
final file = MatrixAudioFile(
|
|
|
|
bytes: await audioFile.readAsBytes(),
|
|
|
|
bytes: bytes,
|
|
|
|
name: result.fileName ?? audioFile.path,
|
|
|
|
name: result.fileName ?? audioFile.path,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
await room.sendFileEvent(
|
|
|
|
await room.sendFileEvent(
|
|
|
|
file,
|
|
|
|
file,
|
|
|
|
inReplyTo: replyEvent,
|
|
|
|
inReplyTo: replyEvent,
|
|
|
|
|