mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-29 17:36:41 +00:00
Remove formatting from search result bodies
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user