mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-03 13:41:07 +03:00
Fix crash of voice broadcast in sc bubble layout
Change-Id: I98561fc79acec42168afd7145fa1df3a5dc2e59c
This commit is contained in:
parent
f437a1a7ad
commit
3333ca8f0c
1 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,7 @@ import im.vector.app.core.resources.isRTL
|
|||
import im.vector.app.features.home.room.detail.timeline.factory.TimelineItemFactoryParams
|
||||
import im.vector.app.features.settings.VectorPreferences
|
||||
import im.vector.app.features.themes.BubbleThemeUtils
|
||||
import im.vector.app.features.voicebroadcast.VoiceBroadcastConstants.STATE_ROOM_VOICE_BROADCAST_INFO
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.events.model.EventType
|
||||
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
|
||||
|
@ -65,6 +66,9 @@ class TimelineMessageLayoutFactory @Inject constructor(
|
|||
private val MSG_TYPES_WITHOUT_BUBBLE_LAYOUT = setOf(
|
||||
MessageType.MSGTYPE_VERIFICATION_REQUEST
|
||||
)
|
||||
private val EVENT_TYPES_WITHOUT_SC_BUBBLE_LAYOUT = setOf(
|
||||
STATE_ROOM_VOICE_BROADCAST_INFO,
|
||||
)
|
||||
|
||||
// Use the bubble layout but without borders
|
||||
private val MSG_TYPES_WITH_PSEUDO_BUBBLE_LAYOUT = setOf(
|
||||
|
@ -255,6 +259,9 @@ class TimelineMessageLayoutFactory @Inject constructor(
|
|||
}
|
||||
|
||||
private fun TimelineEvent.shouldNeverUseScLayout(): Boolean {
|
||||
if (root.getClearType() in EVENT_TYPES_WITHOUT_SC_BUBBLE_LAYOUT) {
|
||||
return true
|
||||
}
|
||||
val messageContent = getLastMessageContent()
|
||||
return messageContent?.msgType in MSG_TYPES_WITHOUT_BUBBLE_LAYOUT
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue