mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
Clean and add towncrier file
This commit is contained in:
parent
1d8b9f879b
commit
4a8a6d170b
5 changed files with 15 additions and 7 deletions
1
newsfragment/3520.misc
Normal file
1
newsfragment/3520.misc
Normal file
|
@ -0,0 +1 @@
|
|||
VoIP: Merge virtual room timeline in corresponding native room (call events only).
|
|
@ -27,14 +27,14 @@ import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
|
|||
class CallUserMapper(private val session: Session, private val protocolsChecker: CallProtocolsChecker) {
|
||||
|
||||
fun nativeRoomForVirtualRoom(roomId: String): String? {
|
||||
if(!protocolsChecker.supportVirtualRooms) return null
|
||||
if (!protocolsChecker.supportVirtualRooms) return null
|
||||
val virtualRoom = session.getRoom(roomId) ?: return null
|
||||
val virtualRoomEvent = virtualRoom.getAccountDataEvent(RoomAccountDataTypes.EVENT_TYPE_VIRTUAL_ROOM)
|
||||
return virtualRoomEvent?.content?.toModel<RoomVirtualContent>()?.nativeRoomId
|
||||
}
|
||||
|
||||
fun virtualRoomForNativeRoom(roomId: String): String? {
|
||||
if(!protocolsChecker.supportVirtualRooms) return null
|
||||
if (!protocolsChecker.supportVirtualRooms) return null
|
||||
val virtualRoomEvents = session.accountDataService().getRoomAccountDataEvents(setOf(RoomAccountDataTypes.EVENT_TYPE_VIRTUAL_ROOM))
|
||||
return virtualRoomEvents.firstOrNull {
|
||||
val virtualRoomContent = it.content.toModel<RoomVirtualContent>()
|
||||
|
|
|
@ -50,7 +50,6 @@ import im.vector.app.features.home.room.detail.composer.rainbow.RainbowGenerator
|
|||
import im.vector.app.features.home.room.detail.sticker.StickerPickerActionHandler
|
||||
import im.vector.app.features.home.room.detail.timeline.factory.TimelineFactory
|
||||
import im.vector.app.features.home.room.detail.timeline.helper.RoomSummariesHolder
|
||||
import im.vector.app.features.home.room.detail.timeline.helper.TimelineSettingsFactory
|
||||
import im.vector.app.features.home.room.detail.timeline.url.PreviewUrlRetriever
|
||||
import im.vector.app.features.home.room.typing.TypingHelper
|
||||
import im.vector.app.features.powerlevel.PowerLevelsObservableFactory
|
||||
|
@ -119,7 +118,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
private val chatEffectManager: ChatEffectManager,
|
||||
private val directRoomHelper: DirectRoomHelper,
|
||||
private val jitsiService: JitsiService,
|
||||
private val timelineFactory: TimelineFactory,
|
||||
timelineFactory: TimelineFactory
|
||||
) : VectorViewModel<RoomDetailViewState, RoomDetailAction, RoomDetailViewEvents>(initialState),
|
||||
Timeline.Listener, ChatEffectManager.Delegate, CallProtocolsChecker.Listener {
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ class CallItemFactory @Inject constructor(
|
|||
isStillActive: Boolean,
|
||||
callback: TimelineEventController.Callback?
|
||||
): CallTileTimelineItem? {
|
||||
val correctedRoomId = session.vectorCallService.userMapper.nativeRoomForVirtualRoom(roomId) ?:roomId
|
||||
val correctedRoomId = session.vectorCallService.userMapper.nativeRoomForVirtualRoom(roomId) ?: roomId
|
||||
val userOfInterest = roomSummariesHolder.get(correctedRoomId)?.toMatrixItem() ?: return null
|
||||
val attributes = messageItemAttributesFactory.create(null, informationData, callback).let {
|
||||
CallTileTimelineItem.Attributes(
|
||||
|
|
|
@ -77,10 +77,18 @@ class MergedTimelines(
|
|||
}
|
||||
|
||||
override fun addListener(listener: Timeline.Listener): Boolean {
|
||||
val mainTimelineListener = ListenerInterceptor(mainTimeline, listener, false, emptyList()) {
|
||||
val mainTimelineListener = ListenerInterceptor(
|
||||
timeline = mainTimeline,
|
||||
wrappedListener = listener,
|
||||
shouldFilterTypes = false,
|
||||
allowedTypes = emptyList()) {
|
||||
processTimelineUpdates(::mainIsInit, mainTimelineEvents, it)
|
||||
}
|
||||
val secondaryTimelineListener = ListenerInterceptor(secondaryTimeline, listener, secondaryTimelineParams.shouldFilterTypes, secondaryTimelineParams.allowedTypes) {
|
||||
val secondaryTimelineListener = ListenerInterceptor(
|
||||
timeline = secondaryTimeline,
|
||||
wrappedListener = listener,
|
||||
shouldFilterTypes = secondaryTimelineParams.shouldFilterTypes,
|
||||
allowedTypes = secondaryTimelineParams.allowedTypes) {
|
||||
processTimelineUpdates(::secondaryIsInit, secondaryTimelineEvents, it)
|
||||
}
|
||||
listenersMapping[listener] = listOf(mainTimelineListener, secondaryTimelineListener)
|
||||
|
|
Loading…
Reference in a new issue