Fix a bug where your own emotes showed as '* You emoted'. (#4038)

This commit is contained in:
Doug
2025-04-17 12:39:41 +01:00
committed by GitHub
parent 4079549803
commit 7cf1d08b20
4 changed files with 85 additions and 37 deletions
@@ -24,7 +24,7 @@ struct RoomMessageEventStringBuilder {
let attributedStringBuilder: AttributedStringBuilderProtocol
let destination: Destination
func buildAttributedString(for messageType: MessageType, senderDisplayName: String) -> AttributedString {
func buildAttributedString(for messageType: MessageType, senderDisplayName: String, isOutgoing: Bool) -> AttributedString {
let message: AttributedString
switch messageType {
case .emote(content: let content):
@@ -69,7 +69,7 @@ struct RoomMessageEventStringBuilder {
}
if destination == .roomList {
return prefix(message, with: senderDisplayName)
return prefix(message, with: isOutgoing ? L10n.commonYou : senderDisplayName)
} else {
return message
}