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);
|
||||
state = (filename, null);
|
||||
|
||||
final room = ref.read(
|
||||
RoomsController.provider.select((value) => value[roomId]),
|
||||
final isEncrypted = ref.read(
|
||||
RoomsController.provider.select(
|
||||
(value) =>
|
||||
value[roomId]?.state[EventType.encryption.type]?.isNotEmpty == true,
|
||||
),
|
||||
);
|
||||
|
||||
final content = await ref
|
||||
.watch(ClientController.provider.notifier)
|
||||
.uploadMedia(
|
||||
.new(
|
||||
path: file.path,
|
||||
encrypt: room?.state[EventType.encryption.type]?.isNotEmpty == true,
|
||||
),
|
||||
);
|
||||
.uploadMedia(.new(path: file.path, encrypt: isEncrypted));
|
||||
|
||||
state = (filename, content);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue