aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/main_window_controller.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2023-01-06 13:19:42 +0100
committerfiaxh <git@lightrise.org>2023-01-06 14:03:54 +0100
commitdc52e7595cca06d0a2da7d11b3c88cb2f7ce529c (patch)
tree111f4a86a8541ce51bba7ec56f5b32197fcefc83 /main/src/ui/main_window_controller.vala
parent4d7809bb12199a598b531ca3ca019a4bb5a867f7 (diff)
downloaddino-dc52e7595cca06d0a2da7d11b3c88cb2f7ce529c.tar.gz
dino-dc52e7595cca06d0a2da7d11b3c88cb2f7ce529c.zip
Add support for XEP-0461 replies (with fallback)
Diffstat (limited to 'main/src/ui/main_window_controller.vala')
-rw-r--r--main/src/ui/main_window_controller.vala15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/src/ui/main_window_controller.vala b/main/src/ui/main_window_controller.vala
index 38ebcc9c..9e7e8ce7 100644
--- a/main/src/ui/main_window_controller.vala
+++ b/main/src/ui/main_window_controller.vala
@@ -23,6 +23,21 @@ public class MainWindowController : Object {
stream_interactor.get_module(ConversationManager.IDENTITY).conversation_deactivated.connect(check_unset_conversation);
stream_interactor.account_removed.connect(check_unset_conversation);
+
+ SimpleAction jump_to_conversatio_message_action = new SimpleAction("jump-to-conversation-message", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32}));
+ jump_to_conversatio_message_action.activate.connect((variant) => {
+ int conversation_id = variant.get_child_value(0).get_int32();
+ Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_by_id(conversation_id);
+ if (conversation == null || !this.conversation.equals(conversation)) return;
+
+ int item_id = variant.get_child_value(1).get_int32();
+ ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_id(conversation, item_id);
+
+ select_conversation(conversation, false, false);
+ window.conversation_view.conversation_frame.initialize_around_message(conversation, content_item);
+ });
+ app.add_action(jump_to_conversatio_message_action);
+
}
public void set_window(MainWindow window) {