mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Remove voice broadcast chunks from the room attachments list
This commit is contained in:
parent
7b4c165033
commit
471bf853c8
@ -22,7 +22,6 @@ import im.vector.app.features.voicebroadcast.VoiceBroadcastConstants
|
||||
import im.vector.app.features.voicebroadcast.isVoiceBroadcast
|
||||
import im.vector.app.features.voicebroadcast.model.VoiceBroadcastState
|
||||
import im.vector.app.features.voicebroadcast.model.asVoiceBroadcastEvent
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
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.RelationType
|
||||
@ -257,7 +256,7 @@ class TimelineEventVisibilityHelper @Inject constructor(
|
||||
return true
|
||||
}
|
||||
|
||||
if (root.asMessageAudioEvent()?.isVoiceBroadcast().orFalse()) {
|
||||
if (root.asMessageAudioEvent().isVoiceBroadcast()) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,12 @@ import dagger.assisted.AssistedInject
|
||||
import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
||||
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.voicebroadcast.isVoiceBroadcast
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.getRoom
|
||||
import org.matrix.android.sdk.api.session.room.model.message.MessageType
|
||||
import org.matrix.android.sdk.api.session.room.model.message.asMessageAudioEvent
|
||||
import org.matrix.android.sdk.flow.flow
|
||||
import org.matrix.android.sdk.flow.unwrap
|
||||
|
||||
@ -78,6 +80,8 @@ class RoomUploadsViewModel @AssistedInject constructor(
|
||||
token = result.nextToken
|
||||
|
||||
val groupedUploadEvents = result.uploadEvents
|
||||
// Remove voice broadcast chunks from the attachments
|
||||
.filterNot { it.root.asMessageAudioEvent().isVoiceBroadcast() }
|
||||
.groupBy {
|
||||
it.contentWithAttachmentContent.msgType == MessageType.MSGTYPE_IMAGE ||
|
||||
it.contentWithAttachmentContent.msgType == MessageType.MSGTYPE_VIDEO
|
||||
|
Loading…
Reference in New Issue
Block a user