Fix fonts and edition on replies

This commit is contained in:
aringenbach
2022-05-04 12:17:21 +02:00
parent 4cdf8b31cd
commit 8077b8058d
10 changed files with 45 additions and 19 deletions
@@ -159,23 +159,25 @@ extension RoomDataSource {
let replyEventParts = parser.parse(event)
let body: String = replyEventParts?.formattedBodyParts?.replyText ?? replyEventParts?.bodyParts.replyText ?? ""
let attributed = eventFormatter.renderHTMLString(body, for: event, with: self.roomState)
let attributed = eventFormatter.renderHTMLString(body, for: event, with: self.roomState, isEditMode: true)
if let attributed = attributed, #available(iOS 15.0, *) {
editableTextMessage = StringPillsUtils.insertPills(in: attributed,
withSession: self.mxSession,
event: event,
andRoomState: self.roomState)
andRoomState: self.roomState,
isEditMode: true)
} else {
editableTextMessage = attributed
}
} else {
let body: String = event.content["formatted_body"] as? String ?? event.content["body"] as? String ?? ""
let attributed = eventFormatter.renderHTMLString(body, for: event, with: self.roomState)
let attributed = eventFormatter.renderHTMLString(body, for: event, with: self.roomState, isEditMode: true)
if let attributed = attributed, #available(iOS 15.0, *) {
editableTextMessage = StringPillsUtils.insertPills(in: attributed,
withSession: self.mxSession,
event: event,
andRoomState: self.roomState)
andRoomState: self.roomState,
isEditMode: true)
} else {
editableTextMessage = attributed
}