diff --git a/lib/src/client.dart b/lib/src/client.dart index 6d304717..6548bfb3 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -783,10 +783,11 @@ class Client extends MatrixApi { bool waitForSync = true, Map? powerLevelContentOverride, CreateRoomPreset? preset = CreateRoomPreset.trustedPrivateChat, + bool skipExistingChat = false, }) async { // Try to find an existing direct chat final directChatRoomId = getDirectChatFromUserId(mxid); - if (directChatRoomId != null) { + if (directChatRoomId != null && !skipExistingChat) { final room = getRoomById(directChatRoomId); if (room != null) { if (room.membership == Membership.join) { @@ -2266,8 +2267,8 @@ class Client extends MatrixApi { /// Immediately start a sync and wait for completion. /// If there is an active sync already, wait for the active sync instead. - Future oneShotSync() { - return _sync(); + Future oneShotSync({Duration? timeout}) { + return _sync(timeout: timeout); } /// Pass a timeout to set how long the server waits before sending an empty response.