mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-24 18:59:36 +00:00
Remove formatting from search result bodies
This commit is contained in:
@@ -124,34 +124,34 @@ struct SearchScreenMessage: Identifiable, Equatable {
|
||||
timestamp = result.timestamp
|
||||
}
|
||||
|
||||
var preview: AttributedString? {
|
||||
var preview: String? {
|
||||
guard let messageBody else { return nil }
|
||||
return AttributedString("\(senderName): ") + messageBody
|
||||
return "\(senderName): \(messageBody)"
|
||||
}
|
||||
|
||||
private var messageBody: AttributedString? {
|
||||
private var messageBody: String? {
|
||||
switch content {
|
||||
case .message(let content):
|
||||
switch content {
|
||||
case .text(let content):
|
||||
content.formattedBody ?? AttributedString(content.body)
|
||||
content.body
|
||||
case .notice(let content):
|
||||
content.formattedBody ?? AttributedString(content.body)
|
||||
content.body
|
||||
case .emote(let content):
|
||||
content.formattedBody ?? AttributedString(content.body)
|
||||
content.body
|
||||
case .audio, .file, .image, .video, .gallery:
|
||||
nil
|
||||
case .voice:
|
||||
AttributedString(L10n.commonVoiceMessage)
|
||||
L10n.commonVoiceMessage
|
||||
case .location:
|
||||
AttributedString(L10n.commonSharedLocation)
|
||||
L10n.commonSharedLocation
|
||||
}
|
||||
case .poll(let question):
|
||||
AttributedString(question)
|
||||
question
|
||||
case .liveLocation:
|
||||
AttributedString(L10n.commonSharedLiveLocation)
|
||||
L10n.commonSharedLiveLocation
|
||||
case .redacted:
|
||||
AttributedString(L10n.commonMessageRemoved)
|
||||
L10n.commonMessageRemoved
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user