fixing wrong transient import

This commit is contained in:
Adam Brown 2022-03-13 13:27:31 +00:00
parent ed2541876f
commit a863625672
2 changed files with 10 additions and 10 deletions

View File

@ -29,15 +29,13 @@ internal class TimelineUseCaseImpl(
MessengerState( MessengerState(
roomState = when { roomState = when {
localEchos.isEmpty() -> roomState localEchos.isEmpty() -> roomState
else -> mergeWithLocalEchosUseCase.invoke( else -> {
roomState, mergeWithLocalEchosUseCase.invoke(
roomService.findMember(roomId, userId) ?: RoomMember( roomState,
userId, roomService.findMember(roomId, userId) ?: userId.toFallbackMember(),
null, localEchos,
avatarUrl = null, )
), }
localEchos,
)
}, },
typing = events.filterIsInstance<SyncService.SyncEvent.Typing>().firstOrNull { it.roomId == roomId }, typing = events.filterIsInstance<SyncService.SyncEvent.Typing>().firstOrNull { it.roomId == roomId },
self = userId, self = userId,
@ -47,6 +45,8 @@ internal class TimelineUseCaseImpl(
} }
private fun UserId.toFallbackMember() = RoomMember(this, displayName = null, avatarUrl = null)
data class MessengerState( data class MessengerState(
val self: UserId, val self: UserId,
val roomState: RoomState, val roomState: RoomState,

View File

@ -12,7 +12,7 @@ import app.dapk.st.matrix.message.internal.DefaultMessageService
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import java.util.* import kotlinx.serialization.Transient
private val SERVICE_KEY = MessageService::class private val SERVICE_KEY = MessageService::class