mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-21 17:05:39 +03:00
Merge pull request #7656 from vector-im/feature/fre/voice_broadcast_room_attachments
[Voice Broadcast] Remove chunks from the room attachments
This commit is contained in:
commit
4b3e36da91
3 changed files with 6 additions and 2 deletions
1
changelog.d/7656.wip
Normal file
1
changelog.d/7656.wip
Normal file
|
@ -0,0 +1 @@
|
|||
Voice Broadcast - Remove voice messages related to a VB from the room attachments
|
|
@ -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 a new issue