fix encrypted uploads
This commit is contained in:
parent
34ddd6d32b
commit
2a91959333
3 changed files with 8 additions and 7 deletions
|
|
@ -26,8 +26,7 @@ class AttachmentController extends Notifier<(String, MessageContent?)?> {
|
|||
.uploadMedia(
|
||||
.new(
|
||||
path: file.path,
|
||||
encrypted:
|
||||
room?.state[EventType.encryption.name]?.isNotEmpty == true,
|
||||
encrypt: room?.state[EventType.encryption.type]?.isNotEmpty == true,
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import "package:nexus/models/info/video.dart";
|
|||
part "message.freezed.dart";
|
||||
part "message.g.dart";
|
||||
|
||||
typedef EncryptedFile = Map<String, dynamic>;
|
||||
|
||||
@Freezed(unionKey: "msgtype", fallbackUnion: "default")
|
||||
abstract class MessageContent extends Content with _$MessageContent {
|
||||
MessageContent._();
|
||||
|
|
@ -38,7 +40,7 @@ abstract class MessageContent extends Content with _$MessageContent {
|
|||
required String body,
|
||||
MessageFormat? format,
|
||||
String? formattedBody,
|
||||
// EncryptedFile? file
|
||||
EncryptedFile? file,
|
||||
String? filename,
|
||||
ImageInfo? info,
|
||||
Uri? url,
|
||||
|
|
@ -49,7 +51,7 @@ abstract class MessageContent extends Content with _$MessageContent {
|
|||
required String body,
|
||||
MessageFormat? format,
|
||||
String? formattedBody,
|
||||
// EncryptedFile? file
|
||||
EncryptedFile? file,
|
||||
String? filename,
|
||||
FileInfo? info,
|
||||
Uri? url,
|
||||
|
|
@ -60,7 +62,7 @@ abstract class MessageContent extends Content with _$MessageContent {
|
|||
required String body,
|
||||
MessageFormat? format,
|
||||
String? formattedBody,
|
||||
// EncryptedFile? file
|
||||
EncryptedFile? file,
|
||||
String? filename,
|
||||
AudioInfo? info,
|
||||
Uri? url,
|
||||
|
|
@ -71,7 +73,7 @@ abstract class MessageContent extends Content with _$MessageContent {
|
|||
required String body,
|
||||
MessageFormat? format,
|
||||
String? formattedBody,
|
||||
// EncryptedFile? file
|
||||
EncryptedFile? file,
|
||||
String? filename,
|
||||
VideoInfo? info,
|
||||
Uri? url,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part "upload_media.g.dart";
|
|||
abstract class UploadMediaRequest with _$UploadMediaRequest {
|
||||
const factory UploadMediaRequest({
|
||||
required String path,
|
||||
required bool encrypted,
|
||||
required bool encrypt,
|
||||
String? filename,
|
||||
@Default(false) @JsonKey(name: "voice_message") bool isVoiceMessage,
|
||||
@Default(false) bool forceFile,
|
||||
|
|
|
|||
Loading…
Reference in a new issue