mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 03:49:04 +03:00
LoadRoomMember: fix presence
This commit is contained in:
parent
1a33f6e094
commit
b446ceded8
1 changed files with 4 additions and 1 deletions
|
@ -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.events.model.EventType
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomMemberContent
|
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.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.database.query.where
|
||||||
import org.matrix.android.sdk.internal.di.UserId
|
import org.matrix.android.sdk.internal.di.UserId
|
||||||
import org.matrix.android.sdk.internal.session.events.getFixedRoomMemberContent
|
import org.matrix.android.sdk.internal.session.events.getFixedRoomMemberContent
|
||||||
|
@ -88,10 +89,12 @@ internal class RoomMemberEventHandler @Inject constructor(
|
||||||
existingRoomMemberSummary.avatarUrl = roomMember.avatarUrl
|
existingRoomMemberSummary.avatarUrl = roomMember.avatarUrl
|
||||||
existingRoomMemberSummary.membership = roomMember.membership
|
existingRoomMemberSummary.membership = roomMember.membership
|
||||||
} else {
|
} else {
|
||||||
|
val presenceEntity = UserPresenceEntity.where(realm, userId).findFirst()
|
||||||
val roomMemberEntity = RoomMemberEntityFactory.create(
|
val roomMemberEntity = RoomMemberEntityFactory.create(
|
||||||
roomId,
|
roomId,
|
||||||
userId,
|
userId,
|
||||||
roomMember
|
roomMember,
|
||||||
|
presenceEntity
|
||||||
)
|
)
|
||||||
realm.insert(roomMemberEntity)
|
realm.insert(roomMemberEntity)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue