From 94e3e5f681bf41aec2c0716f3da18bbf8df7483f Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 26 Jan 2021 14:04:55 +0100 Subject: [PATCH] chore: Determine invites as direct chats too --- lib/src/room.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/room.dart b/lib/src/room.dart index e187cbf0..f76bf06a 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -236,6 +236,12 @@ class Room { /// Returns null otherwise. String get directChatMatrixID { String returnUserId; + if (membership == Membership.invite) { + final invitation = getState(EventTypes.RoomMember, client.userID); + if (invitation != null && invitation.content['is_direct'] == true) { + return invitation.senderId; + } + } if (client.directChats is Map) { client.directChats.forEach((String userId, dynamic roomIds) { if (roomIds is List) {