mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-07 12:58:39 +00:00
Fixes #2706 - Use disambiguated display names for timeline item senders and state event bodies. (#2739)
This commit is contained in:
@@ -21,11 +21,21 @@ struct TimelineItemSender: Identifiable, Hashable {
|
||||
|
||||
let id: String
|
||||
let displayName: String?
|
||||
let isDisplayNameAmbiguous: Bool
|
||||
let avatarURL: URL?
|
||||
|
||||
init(id: String, displayName: String? = nil, avatarURL: URL? = nil) {
|
||||
init(id: String, displayName: String? = nil, isDisplayNameAmbiguous: Bool = false, avatarURL: URL? = nil) {
|
||||
self.id = id
|
||||
self.displayName = displayName
|
||||
self.isDisplayNameAmbiguous = isDisplayNameAmbiguous
|
||||
self.avatarURL = avatarURL
|
||||
}
|
||||
|
||||
var disambiguatedDisplayName: String? {
|
||||
guard let displayName else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return isDisplayNameAmbiguous ? "\(displayName) (\(id))" : displayName
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user