Bump the SDK to v25.01.10-2, fix breaking API changes around sending media and mentions

This commit is contained in:
Stefan Ceriu
2025-01-10 18:19:53 +02:00
committed by Stefan Ceriu
parent 57b85d2650
commit ab334e90af
7 changed files with 280 additions and 186 deletions
@@ -255,11 +255,12 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
message: String,
html: String?,
intentionalMentions: IntentionalMentions) async {
// We're waiting on an API for including mentions: https://github.com/matrix-org/matrix-rust-sdk/issues/4302
MXLog.info("Editing timeline item caption: \(eventOrTransactionID) in \(roomID)")
// When formattedCaption is nil, caption will be parsed as markdown and generate the HTML for us.
let newContent = createCaptionEdit(caption: message, formattedCaption: html.map { .init(format: .html, body: $0) })
let newContent = createCaptionEdit(caption: message,
formattedCaption: html.map { .init(format: .html, body: $0) },
mentions: intentionalMentions.toRustMentions())
switch await activeTimeline.edit(eventOrTransactionID, newContent: newContent) {
case .success:
MXLog.info("Finished editing caption")
@@ -270,7 +271,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
func removeCaption(_ eventOrTransactionID: EventOrTransactionId) async {
// Set a `nil` caption to remove it from the event.
let newContent = createCaptionEdit(caption: nil, formattedCaption: nil)
let newContent = createCaptionEdit(caption: nil, formattedCaption: nil, mentions: nil)
switch await activeTimeline.edit(eventOrTransactionID, newContent: newContent) {
case .success:
MXLog.info("Finished removing caption.")