mirror of
https://github.com/ouchadam/small-talk.git
synced 2024-12-23 00:09:59 +01:00
allowing the canonical alias to be null when parsing the sync response
This commit is contained in:
parent
933197dfd7
commit
95c95c38ca
@ -65,7 +65,7 @@ internal sealed class ApiTimelineEvent {
|
||||
|
||||
@Serializable
|
||||
internal data class Content(
|
||||
@SerialName("alias") val alias: String
|
||||
@SerialName("alias") val alias: String? = null
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ internal class RoomOverviewProcessor(
|
||||
|
||||
private suspend fun roomDisplayName(roomToProcess: RoomToProcess, combinedEvents: List<ApiTimelineEvent>): String? {
|
||||
val roomName = combinedEvents.filterIsInstance<ApiTimelineEvent.RoomName>().lastOrNull()?.content?.name
|
||||
?: combinedEvents.filterIsInstance<ApiTimelineEvent.CanonicalAlias>().lastOrNull()?.content?.alias
|
||||
?: combinedEvents.filterIsInstance<ApiTimelineEvent.CanonicalAlias>().lastOrNull()?.content?.alias?.takeIf { it.isNotEmpty() }
|
||||
?: roomToProcess.heroes?.let {
|
||||
roomMembersService.find(roomToProcess.roomId, it).joinToString { it.displayName ?: it.id.value }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user