aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-12-02 16:45:28 +0100
committerfiaxh <git@lightrise.org>2020-12-03 18:17:11 +0100
commit4f4a1036e1ca17eb105d6f35ed83cfbefd936c77 (patch)
tree59708c9471089a9ef80812a1658defd4b2fe9729
parentcd7c4c82211321ea25b388ea4eb42ee810b25e5f (diff)
downloaddino-4f4a1036e1ca17eb105d6f35ed83cfbefd936c77.tar.gz
dino-4f4a1036e1ca17eb105d6f35ed83cfbefd936c77.zip
Handle xmpp URIs opened within Dino with Dino
fixes #914
-rw-r--r--main/src/ui/conversation_content_view/message_widget.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/ui/conversation_content_view/message_widget.vala b/main/src/ui/conversation_content_view/message_widget.vala
index 3186cfbb..05661e56 100644
--- a/main/src/ui/conversation_content_view/message_widget.vala
+++ b/main/src/ui/conversation_content_view/message_widget.vala
@@ -91,6 +91,7 @@ public class MessageItemWidget : SizeRequestBin {
construct {
this.add(label);
+ label.activate_link.connect(on_label_activate_link);
this.size_request_mode = SizeRequestMode.HEIGHT_FOR_WIDTH;
}
@@ -217,6 +218,14 @@ public class MessageItemWidget : SizeRequestBin {
}
return markup_text;
}
+
+ public static bool on_label_activate_link(string uri) {
+ // Always handle xmpp URIs with Dino
+ if (!uri.has_prefix("xmpp:")) return false;
+ File file = File.new_for_uri(uri);
+ Dino.Application.get_default().open(new File[]{file}, "");
+ return true;
+ }
}
[GtkTemplate (ui = "/im/dino/Dino/message_item_widget_edit_mode.ui")]