mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
85f28d017d
* Update the SDK and handle API breaks. * Rename sdkUserThing to rustUserThing for consistency. * Add user status ClientProxy methods. * Rename UserStatus.UserSet to UserStatus.Raw.
39 lines
1.1 KiB
Swift
39 lines
1.1 KiB
Swift
//
|
|
// Copyright 2026 Element Creations Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import MatrixRustSDK
|
|
import SwiftUI
|
|
|
|
nonisolated struct TimelineItemKeyForwarder: Identifiable, Hashable {
|
|
let id: String
|
|
let displayName: String?
|
|
|
|
init(id: String, displayName: String? = nil) {
|
|
self.id = id
|
|
self.displayName = displayName
|
|
}
|
|
|
|
init(forwarderID: String, forwarderProfile: ProfileDetails) {
|
|
switch forwarderProfile {
|
|
case let .ready(displayName, _, _, _, _):
|
|
self.init(id: forwarderID,
|
|
displayName: displayName)
|
|
default:
|
|
self.init(id: forwarderID,
|
|
displayName: nil)
|
|
}
|
|
}
|
|
|
|
var message: String {
|
|
if let displayName {
|
|
L10n.cryptoEventKeyForwardedKnownProfileDialogContent(displayName, id)
|
|
} else {
|
|
L10n.cryptoEventKeyForwardedUnknownProfileDialogContent(id)
|
|
}
|
|
}
|
|
}
|