mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +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
|
||||
}
|
||||
plainText = context.plainComposerText.string
|
||||
plainText = plainComposerContent.text
|
||||
htmlText = nil
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
||||
}
|
||||
}
|
||||
|
||||
private func sendPlainComposerText() {
|
||||
private var plainComposerContent: PlainComposerContent {
|
||||
let attributedString = NSMutableAttributedString(attributedString: context.plainComposerText)
|
||||
|
||||
var shouldMakeAnotherPass = false
|
||||
@@ -396,9 +396,14 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
|
||||
}
|
||||
} 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,
|
||||
intentionalMentions: .init(userIDs: userIDs, atRoom: containsAtRoom)))
|
||||
intentionalMentions: .init(userIDs: plainComposerContent.mentionedUserIDs, atRoom: plainComposerContent.containsAtRoomMention)))
|
||||
}
|
||||
|
||||
private func processVoiceMessageAction(_ action: ComposerToolbarVoiceMessageAction) {
|
||||
@@ -658,3 +663,9 @@ private final class ComposerMentionReplacer: MentionReplacer {
|
||||
replacementForMentionClosure(url, text)
|
||||
}
|
||||
}
|
||||
|
||||
private struct PlainComposerContent {
|
||||
let text: String
|
||||
let mentionedUserIDs: Set<String>
|
||||
let containsAtRoomMention: Bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user