mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Speed up the room event string builder, bold sender names directly instead of parsing markdown
This commit is contained in:
committed by
Stefan Ceriu
parent
0879102e84
commit
7c69012667
@@ -108,8 +108,11 @@ struct RoomEventStringBuilder {
|
|||||||
|
|
||||||
private func prefix(_ eventSummary: String, with sender: TimelineItemSender) -> AttributedString {
|
private func prefix(_ eventSummary: String, with sender: TimelineItemSender) -> AttributedString {
|
||||||
let attributedEventSummary = AttributedString(eventSummary.trimmingCharacters(in: .whitespacesAndNewlines))
|
let attributedEventSummary = AttributedString(eventSummary.trimmingCharacters(in: .whitespacesAndNewlines))
|
||||||
if let senderDisplayName = sender.displayName,
|
|
||||||
let attributedSenderDisplayName = try? AttributedString(markdown: "**\(senderDisplayName)**") {
|
if let senderDisplayName = sender.displayName {
|
||||||
|
var attributedSenderDisplayName = AttributedString(senderDisplayName)
|
||||||
|
attributedSenderDisplayName.bold()
|
||||||
|
|
||||||
// Don't include the message body in the markdown otherwise it makes tappable links.
|
// Don't include the message body in the markdown otherwise it makes tappable links.
|
||||||
return attributedSenderDisplayName + ": " + attributedEventSummary
|
return attributedSenderDisplayName + ": " + attributedEventSummary
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user