improve matcher for encrypted media
This commit is contained in:
parent
80fa9673bb
commit
f0f426a647
1 changed files with 6 additions and 8 deletions
|
|
@ -17,18 +17,16 @@ class AttachmentController extends Notifier<(String, MessageContent?)?> {
|
||||||
final filename = basename(file.path);
|
final filename = basename(file.path);
|
||||||
state = (filename, null);
|
state = (filename, null);
|
||||||
|
|
||||||
final room = ref.read(
|
final isEncrypted = ref.read(
|
||||||
RoomsController.provider.select((value) => value[roomId]),
|
RoomsController.provider.select(
|
||||||
|
(value) =>
|
||||||
|
value[roomId]?.state[EventType.encryption.type]?.isNotEmpty == true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final content = await ref
|
final content = await ref
|
||||||
.watch(ClientController.provider.notifier)
|
.watch(ClientController.provider.notifier)
|
||||||
.uploadMedia(
|
.uploadMedia(.new(path: file.path, encrypt: isEncrypted));
|
||||||
.new(
|
|
||||||
path: file.path,
|
|
||||||
encrypt: room?.state[EventType.encryption.type]?.isNotEmpty == true,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
state = (filename, content);
|
state = (filename, content);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue