mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-11 18:22:49 +01:00
fix: Dont enable encryption with bots
This commit is contained in:
parent
9c9a2c0bb5
commit
a817773de8
@ -25,23 +25,12 @@ class NewGroupController extends State<NewGroup> {
|
|||||||
final roomID = await showFutureLoadingDialog(
|
final roomID = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () async {
|
||||||
final roomId = await client.createRoom(
|
final roomId = await client.createGroupChat(
|
||||||
preset: publicGroup
|
preset: publicGroup
|
||||||
? sdk.CreateRoomPreset.publicChat
|
? sdk.CreateRoomPreset.publicChat
|
||||||
: sdk.CreateRoomPreset.privateChat,
|
: sdk.CreateRoomPreset.privateChat,
|
||||||
visibility: publicGroup ? sdk.Visibility.public : null,
|
groupName: controller.text.isNotEmpty ? controller.text : null,
|
||||||
roomAliasName: publicGroup && controller.text.isNotEmpty
|
|
||||||
? controller.text.trim().toLowerCase().replaceAll(' ', '_')
|
|
||||||
: null,
|
|
||||||
name: controller.text.isNotEmpty ? controller.text : null,
|
|
||||||
);
|
);
|
||||||
if (client.getRoomById(roomId) == null) {
|
|
||||||
await client.onSync.stream.firstWhere(
|
|
||||||
(sync) => sync.rooms?.join?.containsKey(roomId) ?? false);
|
|
||||||
}
|
|
||||||
if (!publicGroup && client.encryptionEnabled) {
|
|
||||||
await client.getRoomById(roomId).enableEncryption();
|
|
||||||
}
|
|
||||||
return roomId;
|
return roomId;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -253,17 +253,6 @@ class SearchView extends StatelessWidget {
|
|||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
final roomId = await client
|
final roomId = await client
|
||||||
.startDirectChat(foundProfile.userId);
|
.startDirectChat(foundProfile.userId);
|
||||||
if (client.getRoomById(roomId) == null) {
|
|
||||||
await client.onSync.stream.firstWhere((sync) =>
|
|
||||||
sync.rooms?.join?.containsKey(roomId) ??
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
final room = client.getRoomById(roomId);
|
|
||||||
if (client.encryptionEnabled && !room.encrypted) {
|
|
||||||
await client
|
|
||||||
.getRoomById(roomId)
|
|
||||||
.enableEncryption();
|
|
||||||
}
|
|
||||||
return roomId;
|
return roomId;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -88,15 +88,6 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
|||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () async {
|
||||||
final roomId = await widget.user.startDirectChat();
|
final roomId = await widget.user.startDirectChat();
|
||||||
final client = widget.user.room.client;
|
|
||||||
if (client.getRoomById(roomId) == null) {
|
|
||||||
await client.onSync.stream.firstWhere(
|
|
||||||
(sync) => sync.rooms?.join?.containsKey(roomId) ?? false);
|
|
||||||
}
|
|
||||||
final room = client.getRoomById(roomId);
|
|
||||||
if (client.encryptionEnabled && !room.encrypted) {
|
|
||||||
await client.getRoomById(roomId).enableEncryption();
|
|
||||||
}
|
|
||||||
return roomId;
|
return roomId;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -27,14 +27,6 @@ class ProfileBottomSheet extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () async {
|
||||||
final roomId = await client.startDirectChat(userId);
|
final roomId = await client.startDirectChat(userId);
|
||||||
if (client.getRoomById(roomId) == null) {
|
|
||||||
await client.onSync.stream.firstWhere(
|
|
||||||
(sync) => sync.rooms?.join?.containsKey(roomId) ?? false);
|
|
||||||
}
|
|
||||||
final room = client.getRoomById(roomId);
|
|
||||||
if (client.encryptionEnabled && !room.encrypted) {
|
|
||||||
await client.getRoomById(roomId).enableEncryption();
|
|
||||||
}
|
|
||||||
return roomId;
|
return roomId;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user