mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
merged element 1.10.12 into bum
This commit is contained in:
@@ -58,6 +58,22 @@ extension RoomViewController {
|
||||
}
|
||||
}
|
||||
|
||||
@objc func setCommand(_ command: String) {
|
||||
if let wysiwygInputToolbar, wysiwygInputToolbar.textFormattingEnabled {
|
||||
wysiwygInputToolbar.command(command)
|
||||
wysiwygInputToolbar.becomeFirstResponder()
|
||||
} else {
|
||||
guard let attributedText = inputToolbarView.attributedTextMessage else { return }
|
||||
|
||||
let newAttributedString = NSMutableAttributedString(attributedString: attributedText)
|
||||
newAttributedString.append(NSAttributedString(string: "\(command) ",
|
||||
attributes: [.font: inputToolbarView.defaultFont]))
|
||||
|
||||
inputToolbarView.attributedTextMessage = newAttributedString
|
||||
inputToolbarView.becomeFirstResponder()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Send the formatted text message and its raw counterpart to the room
|
||||
///
|
||||
@@ -91,7 +107,7 @@ extension RoomViewController {
|
||||
"event_id": eventModified.eventId
|
||||
])
|
||||
})
|
||||
} else if !self.send(asIRCStyleCommandIfPossible: rawTextMsg) {
|
||||
} else {
|
||||
roomDataSource.sendFormattedTextMessage(rawTextMsg, html: htmlMsg) { response in
|
||||
switch response {
|
||||
case .success:
|
||||
|
||||
Reference in New Issue
Block a user