Merge branch 'develop' into dla/feature/connect_sdk_to_global_notifications_ui

This commit is contained in:
David Langley 2023-09-14 09:52:07 +01:00 committed by GitHub
commit 9cf4346805
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,22 +46,22 @@ class EventMessageMapper {
fun map(message: Message): MessageContent = message.use {
val type = it.msgtype().use(this::mapMessageType)
val inReplyToId = it.inReplyTo()?.eventId?.let(::EventId)
val inReplyToEvent: InReplyTo? = it.inReplyTo()?.event?.use { details ->
when (details) {
val inReplyToEvent: InReplyTo? = it.inReplyTo()?.use { details ->
val inReplyToId = EventId(details.eventId)
when (val event = details.event) {
is RepliedToEventDetails.Ready -> {
val senderProfile = details.senderProfile as? ProfileDetails.Ready
val senderProfile = event.senderProfile as? ProfileDetails.Ready
InReplyTo.Ready(
eventId = inReplyToId!!,
content = timelineEventContentMapper.map(details.content),
senderId = UserId(details.sender),
eventId = inReplyToId,
content = timelineEventContentMapper.map(event.content),
senderId = UserId(event.sender),
senderDisplayName = senderProfile?.displayName,
senderAvatarUrl = senderProfile?.avatarUrl,
)
}
is RepliedToEventDetails.Error -> InReplyTo.Error
is RepliedToEventDetails.Pending -> InReplyTo.Pending
is RepliedToEventDetails.Unavailable -> InReplyTo.NotLoaded(inReplyToId!!)
is RepliedToEventDetails.Unavailable -> InReplyTo.NotLoaded(inReplyToId)
}
}
MessageContent(