mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-17 14:30:40 +01:00
fix: Enable E2EE by default in all start chat cases
This commit is contained in:
parent
599c0acb7f
commit
5705ebdaab
@ -86,7 +86,19 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
|||||||
case 'message':
|
case 'message':
|
||||||
final roomIdResult = await showFutureLoadingDialog(
|
final roomIdResult = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => widget.user.startDirectChat(),
|
future: () async {
|
||||||
|
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;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
if (roomIdResult.error != null) return;
|
if (roomIdResult.error != null) return;
|
||||||
VRouter.of(widget.outerContext)
|
VRouter.of(widget.outerContext)
|
||||||
|
@ -247,9 +247,23 @@ class SearchView extends StatelessWidget {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
final roomID = await showFutureLoadingDialog(
|
final roomID = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => Matrix.of(context)
|
future: () async {
|
||||||
.client
|
final client = Matrix.of(context).client;
|
||||||
.startDirectChat(foundProfile.userId),
|
final roomId = await client
|
||||||
|
.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;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
if (roomID.error == null) {
|
if (roomID.error == null) {
|
||||||
VRouter.of(context)
|
VRouter.of(context)
|
||||||
|
@ -748,7 +748,7 @@ packages:
|
|||||||
name: matrix
|
name: matrix
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.1"
|
version: "0.6.2"
|
||||||
matrix_api_lite:
|
matrix_api_lite:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user