mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
FIX: saving draft did not save the pill markdown content (#3003)
This commit is contained in:
@@ -310,7 +310,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
plainText = context.plainComposerText.string
|
plainText = plainComposerContent.text
|
||||||
htmlText = nil
|
htmlText = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func sendPlainComposerText() {
|
private var plainComposerContent: PlainComposerContent {
|
||||||
let attributedString = NSMutableAttributedString(attributedString: context.plainComposerText)
|
let attributedString = NSMutableAttributedString(attributedString: context.plainComposerText)
|
||||||
|
|
||||||
var shouldMakeAnotherPass = false
|
var shouldMakeAnotherPass = false
|
||||||
@@ -396,9 +396,14 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
|||||||
}
|
}
|
||||||
} while shouldMakeAnotherPass
|
} while shouldMakeAnotherPass
|
||||||
|
|
||||||
actionsSubject.send(.sendMessage(plain: attributedString.string, html: nil,
|
return .init(text: attributedString.string, mentionedUserIDs: userIDs, containsAtRoomMention: containsAtRoom)
|
||||||
|
}
|
||||||
|
|
||||||
|
private func sendPlainComposerText() {
|
||||||
|
let plainComposerContent = plainComposerContent
|
||||||
|
actionsSubject.send(.sendMessage(plain: plainComposerContent.text, html: nil,
|
||||||
mode: state.composerMode,
|
mode: state.composerMode,
|
||||||
intentionalMentions: .init(userIDs: userIDs, atRoom: containsAtRoom)))
|
intentionalMentions: .init(userIDs: plainComposerContent.mentionedUserIDs, atRoom: plainComposerContent.containsAtRoomMention)))
|
||||||
}
|
}
|
||||||
|
|
||||||
private func processVoiceMessageAction(_ action: ComposerToolbarVoiceMessageAction) {
|
private func processVoiceMessageAction(_ action: ComposerToolbarVoiceMessageAction) {
|
||||||
@@ -658,3 +663,9 @@ private final class ComposerMentionReplacer: MentionReplacer {
|
|||||||
replacementForMentionClosure(url, text)
|
replacementForMentionClosure(url, text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private struct PlainComposerContent {
|
||||||
|
let text: String
|
||||||
|
let mentionedUserIDs: Set<String>
|
||||||
|
let containsAtRoomMention: Bool
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user