From b446ceded885f5a93b95fadc40801cb705c7d198 Mon Sep 17 00:00:00 2001 From: ganfra Date: Wed, 29 Jun 2022 19:01:23 +0200 Subject: [PATCH] LoadRoomMember: fix presence --- .../session/room/membership/RoomMemberEventHandler.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/RoomMemberEventHandler.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/RoomMemberEventHandler.kt index 63c23de659..fd6552525e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/RoomMemberEventHandler.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/membership/RoomMemberEventHandler.kt @@ -22,6 +22,7 @@ import org.matrix.android.sdk.api.session.events.model.Event import org.matrix.android.sdk.api.session.events.model.EventType import org.matrix.android.sdk.api.session.room.model.RoomMemberContent import org.matrix.android.sdk.internal.database.model.RoomMemberSummaryEntity +import org.matrix.android.sdk.internal.database.model.presence.UserPresenceEntity import org.matrix.android.sdk.internal.database.query.where import org.matrix.android.sdk.internal.di.UserId import org.matrix.android.sdk.internal.session.events.getFixedRoomMemberContent @@ -88,10 +89,12 @@ internal class RoomMemberEventHandler @Inject constructor( existingRoomMemberSummary.avatarUrl = roomMember.avatarUrl existingRoomMemberSummary.membership = roomMember.membership } else { + val presenceEntity = UserPresenceEntity.where(realm, userId).findFirst() val roomMemberEntity = RoomMemberEntityFactory.create( roomId, userId, - roomMember + roomMember, + presenceEntity ) realm.insert(roomMemberEntity) }