From 5a257be624036edb4f612dc28eb3bb08719cc131 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Wed, 7 Dec 2022 09:56:33 +0100 Subject: [PATCH] Prioritize call events against live broadcast --- .../app/features/home/room/list/RoomSummaryItemFactory.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt index fa9588f5fab..86ecdb4f3eb 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt @@ -36,6 +36,7 @@ import im.vector.app.features.voicebroadcast.model.asVoiceBroadcastEvent import im.vector.app.features.voicebroadcast.usecase.GetRoomMostRecentVoiceBroadcastUseCase import im.vector.lib.core.utils.epoxy.charsequence.toEpoxyCharSequence import org.matrix.android.sdk.api.extensions.orFalse +import org.matrix.android.sdk.api.session.events.model.EventType import org.matrix.android.sdk.api.session.getRoom import org.matrix.android.sdk.api.session.room.getTimelineEvent import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState @@ -245,7 +246,8 @@ class RoomSummaryItemFactory @Inject constructor( val liveVoiceBroadcastTimelineEvent = getRoomMostRecentVoiceBroadcastUseCase.execute(roomId) ?.takeIf { it.isLive } ?.root?.eventId?.let { room.getTimelineEvent(it) } - return liveVoiceBroadcastTimelineEvent + return latestPreviewableEvent?.takeIf { EventType.isCallEvent(it.root.getClearType()) } + ?: liveVoiceBroadcastTimelineEvent ?: latestPreviewableEvent ?.takeUnless { it.root.asMessageAudioEvent()?.isVoiceBroadcast().orFalse() } // Skip voice messages related to voice broadcast }