aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2024-07-26 19:10:35 +0200
committerfiaxh <git@lightrise.org>2024-07-29 13:15:14 +0200
commitceb921a0148f7fdc2a9df3e6b85143bf8c26c341 (patch)
treebdbfe4523453b29fa962d36121be40f5ee147e18 /main
parentca980ea409b75025aa8218782d415ba9cf69e1c6 (diff)
downloaddino-ceb921a0148f7fdc2a9df3e6b85143bf8c26c341.tar.gz
dino-ceb921a0148f7fdc2a9df3e6b85143bf8c26c341.zip
Store reply message as sent, with fallback
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/chat_input/chat_input_controller.vala13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/ui/chat_input/chat_input_controller.vala b/main/src/ui/chat_input/chat_input_controller.vala
index d1c42d35..cf8e5a02 100644
--- a/main/src/ui/chat_input/chat_input_controller.vala
+++ b/main/src/ui/chat_input/chat_input_controller.vala
@@ -1,6 +1,7 @@
using Gee;
using Gdk;
using Gtk;
+using Xmpp;
using Dino.Entities;
@@ -195,7 +196,17 @@ public class ChatInputController : Object {
}
Message out_message = stream_interactor.get_module(MessageProcessor.IDENTITY).create_out_message(text, conversation);
if (quoted_content_item_bak != null) {
- stream_interactor.get_module(Replies.IDENTITY).set_message_is_reply_to(out_message, quoted_content_item_bak);
+ 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);
}