Remove formatting from search result bodies

This commit is contained in:
Stefan Ceriu
2026-10-19 13:28:46 +03:00
parent 40d991f256
commit 8055f59b13
@@ -124,34 +124,34 @@ struct SearchScreenMessage: Identifiable, Equatable {
timestamp = result.timestamp timestamp = result.timestamp
} }
var preview: AttributedString? { var preview: String? {
guard let messageBody else { return nil } guard let messageBody else { return nil }
return AttributedString("\(senderName): ") + messageBody return "\(senderName): \(messageBody)"
} }
private var messageBody: AttributedString? { private var messageBody: String? {
switch content { switch content {
case .message(let content): case .message(let content):
switch content { switch content {
case .text(let content): case .text(let content):
content.formattedBody ?? AttributedString(content.body) content.body
case .notice(let content): case .notice(let content):
content.formattedBody ?? AttributedString(content.body) content.body
case .emote(let content): case .emote(let content):
content.formattedBody ?? AttributedString(content.body) content.body
case .audio, .file, .image, .video, .gallery: case .audio, .file, .image, .video, .gallery:
nil nil
case .voice: case .voice:
AttributedString(L10n.commonVoiceMessage) L10n.commonVoiceMessage
case .location: case .location:
AttributedString(L10n.commonSharedLocation) L10n.commonSharedLocation
} }
case .poll(let question): case .poll(let question):
AttributedString(question) question
case .liveLocation: case .liveLocation:
AttributedString(L10n.commonSharedLiveLocation) L10n.commonSharedLiveLocation
case .redacted: case .redacted:
AttributedString(L10n.commonMessageRemoved) L10n.commonMessageRemoved
} }
} }