fix: Dont enable e2ee without encryption support
This also adds a missing visibility parameter to the createGroupChat method.
This commit is contained in:
parent
77d7249699
commit
c8c4562f70
|
|
@ -568,7 +568,8 @@ class Client extends MatrixApi {
|
||||||
final directChatRoomId = getDirectChatFromUserId(mxid);
|
final directChatRoomId = getDirectChatFromUserId(mxid);
|
||||||
if (directChatRoomId != null) return directChatRoomId;
|
if (directChatRoomId != null) return directChatRoomId;
|
||||||
|
|
||||||
enableEncryption ??= await userOwnsEncryptionKeys(mxid);
|
enableEncryption ??=
|
||||||
|
encryptionEnabled && await userOwnsEncryptionKeys(mxid);
|
||||||
if (enableEncryption) {
|
if (enableEncryption) {
|
||||||
initialState ??= [];
|
initialState ??= [];
|
||||||
if (!initialState.any((s) => s.type == EventTypes.Encryption)) {
|
if (!initialState.any((s) => s.type == EventTypes.Encryption)) {
|
||||||
|
|
@ -609,6 +610,7 @@ class Client extends MatrixApi {
|
||||||
List<String>? invite,
|
List<String>? invite,
|
||||||
CreateRoomPreset preset = CreateRoomPreset.privateChat,
|
CreateRoomPreset preset = CreateRoomPreset.privateChat,
|
||||||
List<StateEvent>? initialState,
|
List<StateEvent>? initialState,
|
||||||
|
Visibility? visibility,
|
||||||
bool waitForSync = true,
|
bool waitForSync = true,
|
||||||
}) async {
|
}) async {
|
||||||
enableEncryption ??=
|
enableEncryption ??=
|
||||||
|
|
@ -629,6 +631,7 @@ class Client extends MatrixApi {
|
||||||
preset: preset,
|
preset: preset,
|
||||||
name: groupName,
|
name: groupName,
|
||||||
initialState: initialState,
|
initialState: initialState,
|
||||||
|
visibility: visibility,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (waitForSync) {
|
if (waitForSync) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue