mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Prefix the user's own messages with 'You' in the room list. (#4022)
This commit is contained in:
@@ -610,6 +610,8 @@ internal enum L10n {
|
||||
internal static var commonWaiting: String { return L10n.tr("Localizable", "common_waiting") }
|
||||
/// Waiting for this message
|
||||
internal static var commonWaitingForDecryptionKey: String { return L10n.tr("Localizable", "common_waiting_for_decryption_key") }
|
||||
/// You
|
||||
internal static var commonYou: String { return L10n.tr("Localizable", "common_you") }
|
||||
/// Confirm your recovery key to maintain access to your key storage and message history.
|
||||
internal static var confirmRecoveryKeyBannerMessage: String { return L10n.tr("Localizable", "confirm_recovery_key_banner_message") }
|
||||
/// Enter your recovery key
|
||||
@@ -2969,8 +2971,6 @@ internal enum L10n {
|
||||
internal static var pinned: String { return L10n.tr("Localizable", "common.pinned") }
|
||||
/// Send to
|
||||
internal static var sendTo: String { return L10n.tr("Localizable", "common.send_to") }
|
||||
/// You
|
||||
internal static var you: String { return L10n.tr("Localizable", "common.you") }
|
||||
}
|
||||
}
|
||||
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length
|
||||
|
||||
@@ -12,6 +12,7 @@ import MatrixRustSDK
|
||||
struct EventTimelineItemSDKMockConfiguration {
|
||||
var eventID: String = UUID().uuidString
|
||||
var sender = ""
|
||||
var senderProfile: ProfileDetails?
|
||||
var isOwn = false
|
||||
var content: TimelineItemContent = .msgLike(content: .init(kind: .redacted, reactions: [], threadRoot: nil, inReplyTo: nil))
|
||||
}
|
||||
@@ -21,7 +22,7 @@ extension EventTimelineItem {
|
||||
self.init(isRemote: true,
|
||||
eventOrTransactionId: .eventId(eventId: configuration.eventID),
|
||||
sender: configuration.sender,
|
||||
senderProfile: .pending,
|
||||
senderProfile: configuration.senderProfile ?? .pending,
|
||||
isOwn: configuration.isOwn,
|
||||
isEditable: false,
|
||||
content: configuration.content,
|
||||
|
||||
@@ -17,7 +17,9 @@ struct RoomEventStringBuilder {
|
||||
func buildAttributedString(for eventItemProxy: EventTimelineItemProxy) -> AttributedString? {
|
||||
let sender = eventItemProxy.sender
|
||||
let isOutgoing = eventItemProxy.isOwn
|
||||
let displayName = if shouldDisambiguateDisplayNames {
|
||||
let displayName = if isOutgoing {
|
||||
L10n.commonYou
|
||||
} else if shouldDisambiguateDisplayNames {
|
||||
sender.disambiguatedDisplayName ?? sender.id
|
||||
} else {
|
||||
sender.displayName ?? sender.id
|
||||
|
||||
Reference in New Issue
Block a user