From dc52e7595cca06d0a2da7d11b3c88cb2f7ce529c Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 6 Jan 2023 13:19:42 +0100 Subject: Add support for XEP-0461 replies (with fallback) --- main/src/ui/chat_input/view.vala | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'main/src/ui/chat_input/view.vala') diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala index 4be4455b..e16b4085 100644 --- a/main/src/ui/chat_input/view.vala +++ b/main/src/ui/chat_input/view.vala @@ -20,8 +20,8 @@ public class View : Box { private HashMap entry_cache = new HashMap(Conversation.hash_func, Conversation.equals_func); [GtkChild] public unowned Frame frame; + [GtkChild] public unowned Box quote_box; [GtkChild] public unowned ChatTextView chat_text_view; - [GtkChild] public unowned Box outer_box; [GtkChild] public unowned Button file_button; [GtkChild] public unowned MenuButton emoji_button; [GtkChild] public unowned MenuButton encryption_button; @@ -94,6 +94,19 @@ public class View : Box { }); } + public void set_quoted_message(Widget quote_widget) { + Widget? quote_box_child = quote_box.get_first_child(); + if (quote_box_child != null) quote_box.remove(quote_box_child); + quote_box.append(quote_widget); + quote_box.visible = true; + } + + public void unset_quoted_message() { + Widget? quote_box_child = quote_box.get_first_child(); + if (quote_box_child != null) quote_box.remove(quote_box_child); + quote_box.visible = false; + } + public void do_focus() { chat_text_view.text_view.grab_focus(); } -- cgit v1.2.3-54-g00ecf