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

View File

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