mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Adopt the new latest event API. (#4779)
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MatrixRustSDK
|
||||
import SwiftUI
|
||||
|
||||
struct TimelineItemSender: Identifiable, Hashable {
|
||||
static let test = TimelineItemSender(id: "@test.matrix.org")
|
||||
@@ -22,6 +23,21 @@ struct TimelineItemSender: Identifiable, Hashable {
|
||||
self.isDisplayNameAmbiguous = isDisplayNameAmbiguous
|
||||
self.avatarURL = avatarURL
|
||||
}
|
||||
|
||||
init(senderID: String, senderProfile: ProfileDetails) {
|
||||
switch senderProfile {
|
||||
case let .ready(displayName, isDisplayNameAmbiguous, avatarUrl):
|
||||
self.init(id: senderID,
|
||||
displayName: displayName,
|
||||
isDisplayNameAmbiguous: isDisplayNameAmbiguous,
|
||||
avatarURL: avatarUrl.flatMap(URL.init(string:)))
|
||||
default:
|
||||
self.init(id: senderID,
|
||||
displayName: nil,
|
||||
isDisplayNameAmbiguous: false,
|
||||
avatarURL: nil)
|
||||
}
|
||||
}
|
||||
|
||||
var disambiguatedDisplayName: String? {
|
||||
guard let displayName else {
|
||||
|
||||
Reference in New Issue
Block a user