Load member profiles through the timeline (#522)

This commit is contained in:
Stefan Ceriu
2023-02-03 12:12:36 +02:00
committed by GitHub
parent 3f900df3de
commit 183cc88114
8 changed files with 34 additions and 78 deletions
@@ -106,9 +106,17 @@ struct EventTimelineItemProxy: CustomDebugStringConvertible {
var sender: TimelineItemSender {
let profile = item.senderProfile()
return .init(id: item.sender(),
displayName: profile.displayName,
avatarURL: profile.avatarUrl.flatMap(URL.init(string:)))
switch profile {
case let .ready(displayName, _, avatarUrl):
return .init(id: item.sender(),
displayName: displayName,
avatarURL: avatarUrl.flatMap(URL.init(string:)))
default:
return .init(id: item.sender(),
displayName: nil,
avatarURL: nil)
}
}
var reactions: [Reaction] {