Handle xmpp URIs opened within Dino with Dino

fixes #914
This commit is contained in:
fiaxh 2020-12-02 16:45:28 +01:00
parent cd7c4c8221
commit 4f4a1036e1

View file

@ -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")]