Merge branch 'krille/invite-direct-chat' into 'main'
chore: Determine invites as direct chats too Closes app#1110 See merge request famedly/famedlysdk!624
This commit is contained in:
commit
f58da0c33f
|
|
@ -236,6 +236,12 @@ class Room {
|
||||||
/// Returns null otherwise.
|
/// Returns null otherwise.
|
||||||
String get directChatMatrixID {
|
String get directChatMatrixID {
|
||||||
String returnUserId;
|
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<String, dynamic>) {
|
if (client.directChats is Map<String, dynamic>) {
|
||||||
client.directChats.forEach((String userId, dynamic roomIds) {
|
client.directChats.forEach((String userId, dynamic roomIds) {
|
||||||
if (roomIds is List<dynamic>) {
|
if (roomIds is List<dynamic>) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue