diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 76d61c9c46..e43afda5ee 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -161,7 +161,7 @@ class ChatController extends State { .firstWhere((s) => s.rooms?.leave?.containsKey(room.id) ?? false); await room.leave(); await waitForSync; - return await client.startDirectChat(userId); + return await client.startDirectChat(userId, enableEncryption: true); }, ); final roomId = success.result; diff --git a/lib/pages/new_group/new_group.dart b/lib/pages/new_group/new_group.dart index 29d6278e52..5ea21b358e 100644 --- a/lib/pages/new_group/new_group.dart +++ b/lib/pages/new_group/new_group.dart @@ -26,13 +26,19 @@ class NewGroupController extends State { context: context, future: () async { final roomId = await client.createGroupChat( + enableEncryption: true, + visibility: sdk.Visibility.private, + preset: sdk.CreateRoomPreset.privateChat, + /* #schulChatSpecific visibility: publicGroup ? sdk.Visibility.public : sdk.Visibility.private, - preset: publicGroup - ? sdk.CreateRoomPreset.publicChat + preset: publicGroupx + ? sdk.CreateRoomPreset.publicChatx : sdk.CreateRoomPreset.privateChat, + */ groupName: controller.text.isNotEmpty ? controller.text : null, ); + return roomId; }, ); diff --git a/lib/pages/new_group/new_group_view.dart b/lib/pages/new_group/new_group_view.dart index 7aec730adc..64d225e172 100644 --- a/lib/pages/new_group/new_group_view.dart +++ b/lib/pages/new_group/new_group_view.dart @@ -35,18 +35,20 @@ class NewGroupView extends StatelessWidget { ), ), ), + /* #schulChatSpecific SwitchListTile.adaptive( secondary: const Icon(Icons.public_outlined), title: Text(L10n.of(context)!.groupIsPublic), - value: controller.publicGroup, + value: false, //controller.publicGroup, #schulChatSpecific onChanged: controller.setPublicGroup, ), SwitchListTile.adaptive( secondary: const Icon(Icons.lock_outlined), title: Text(L10n.of(context)!.enableEncryption), - value: !controller.publicGroup, + value: true , //!controller.publicGroup, #schulChatSpecific onChanged: null, ), + */ ], ), ), diff --git a/lib/pages/story/story_page.dart b/lib/pages/story/story_page.dart index 2db5c5b7f7..28c43d8c24 100644 --- a/lib/pages/story/story_page.dart +++ b/lib/pages/story/story_page.dart @@ -496,8 +496,8 @@ class StoryPageController extends State { case PopupStoryAction.message: final roomIdResult = await showFutureLoadingDialog( context: context, - future: () => - currentEvent!.senderFromMemoryOrFallback.startDirectChat(), + future: () => currentEvent!.senderFromMemoryOrFallback + .startDirectChat(enableEncryption: true), ); if (roomIdResult.error != null) return; VRouter.of(context).toSegments(['rooms', roomIdResult.result!]); diff --git a/lib/pages/user_bottom_sheet/user_bottom_sheet.dart b/lib/pages/user_bottom_sheet/user_bottom_sheet.dart index 1be9b1fc7d..ba2ee7bfc8 100644 --- a/lib/pages/user_bottom_sheet/user_bottom_sheet.dart +++ b/lib/pages/user_bottom_sheet/user_bottom_sheet.dart @@ -144,7 +144,7 @@ class UserBottomSheetController extends State { case UserBottomSheetAction.message: final roomIdResult = await showFutureLoadingDialog( context: context, - future: () => widget.user.startDirectChat(), + future: () => widget.user.startDirectChat(enableEncryption: true), ); if (roomIdResult.error != null) return; VRouter.of(widget.outerContext) diff --git a/lib/widgets/profile_bottom_sheet.dart b/lib/widgets/profile_bottom_sheet.dart index dffa71c032..c5134c7908 100644 --- a/lib/widgets/profile_bottom_sheet.dart +++ b/lib/widgets/profile_bottom_sheet.dart @@ -22,7 +22,7 @@ class ProfileBottomSheet extends StatelessWidget { final client = Matrix.of(context).client; final result = await showFutureLoadingDialog( context: context, - future: () => client.startDirectChat(userId), + future: () => client.startDirectChat(userId, enableEncryption: true), ); if (result.error == null) { VRouter.of(context).toSegments(['rooms', result.result!]);