Skip to content

Commit

Permalink
Prioritize call events against live broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Renaud committed Dec 7, 2022
1 parent b6d41b0 commit 5a257be
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 5a257be

Please sign in to comment.