Skip to content

Commit

Permalink
Calculate displayname in Timeline when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Buquet committed Oct 14, 2024
1 parent 0989da0 commit 7108dc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ElementX/Sources/Services/Timeline/TimelineItemSender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ struct TimelineItemSender: Identifiable, Hashable {

init(id: String, displayName: String? = nil, isDisplayNameAmbiguous: Bool = false, avatarURL: URL? = nil) {
self.id = id
self.displayName = displayName
// Tchap : if `displayName` is nil, calculate it from userId.
// self.displayName = displayName
self.displayName = displayName ?? MatrixIdFromString(id).userDisplayName?.displayName
self.isDisplayNameAmbiguous = isDisplayNameAmbiguous
self.avatarURL = avatarURL
}
Expand Down

0 comments on commit 7108dc2

Please sign in to comment.