aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input/chat_input_controller.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2024-07-29 13:16:54 +0200
committerfiaxh <git@lightrise.org>2024-07-29 13:16:54 +0200
commitb0ff90a14a5d127e17f2371f87e7bb659de3a68f (patch)
treea4b44a2837f94bef433adc318eb9a738425a494f /main/src/ui/chat_input/chat_input_controller.vala
parentceb921a0148f7fdc2a9df3e6b85143bf8c26c341 (diff)
downloaddino-b0ff90a14a5d127e17f2371f87e7bb659de3a68f.tar.gz
dino-b0ff90a14a5d127e17f2371f87e7bb659de3a68f.zip
Add initial message markup (XEP-0394) support
Diffstat (limited to 'main/src/ui/chat_input/chat_input_controller.vala')
-rw-r--r--main/src/ui/chat_input/chat_input_controller.vala19
1 files changed, 4 insertions, 15 deletions
diff --git a/main/src/ui/chat_input/chat_input_controller.vala b/main/src/ui/chat_input/chat_input_controller.vala
index cf8e5a02..07499aa4 100644
--- a/main/src/ui/chat_input/chat_input_controller.vala
+++ b/main/src/ui/chat_input/chat_input_controller.vala
@@ -3,6 +3,7 @@ using Gdk;
using Gtk;
using Xmpp;
+using Xmpp;
using Dino.Entities;
namespace Dino.Ui {
@@ -136,6 +137,7 @@ public class ChatInputController : Object {
string text = chat_input.chat_text_view.text_view.buffer.text;
ContentItem? quoted_content_item_bak = quoted_content_item;
+ var markups = chat_input.chat_text_view.get_markups();
// Reset input state. Has do be done before parsing commands, because those directly return.
chat_input.chat_text_view.text_view.buffer.text = "";
@@ -194,21 +196,8 @@ public class ChatInputController : Object {
break;
}
}
- Message out_message = stream_interactor.get_module(MessageProcessor.IDENTITY).create_out_message(text, conversation);
- if (quoted_content_item_bak != null) {
- out_message.set_quoted_item(quoted_content_item_bak.id);
-
- // Store body with fallback
- string fallback = FallbackBody.get_quoted_fallback_body(quoted_content_item_bak);
- out_message.body = fallback + out_message.body;
-
- // Store fallback location
- var fallback_location = new Xep.FallbackIndication.FallbackLocation(0, (int)fallback.char_count());
- var fallback_list = new ArrayList<Xep.FallbackIndication.Fallback>();
- fallback_list.add(new Xep.FallbackIndication.Fallback(Xep.Replies.NS_URI, new Xep.FallbackIndication.FallbackLocation[] { fallback_location }));
- out_message.set_fallbacks(fallback_list);
- }
- stream_interactor.get_module(MessageProcessor.IDENTITY).send_message(out_message, conversation);
+
+ Dino.send_message(conversation, text, quoted_content_item_bak != null ? quoted_content_item_bak.id : 0, null, markups);
}
private void on_text_input_changed() {