From 010b166fd27e18817997aa4a03e11791e665f5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Thu, 30 Nov 2017 19:47:39 +0100 Subject: [PATCH] Handle ?roster uris --- gajim/app_actions.py | 5 +++++ gajim/gajim.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gajim/app_actions.py b/gajim/app_actions.py index cca92058d..b25a87007 100644 --- a/gajim/app_actions.py +++ b/gajim/app_actions.py @@ -44,6 +44,11 @@ class AppActions(): def __init__(self, application: Gtk.Application): self.application = application + # General Actions + + def on_add_contact_jid(self, action, param): + dialogs.AddNewContactWindow(None, param.get_string()) + # Application Menu Actions def on_preferences(self, action, param): diff --git a/gajim/gajim.py b/gajim/gajim.py index dc023a802..21f015749 100644 --- a/gajim/gajim.py +++ b/gajim/gajim.py @@ -242,6 +242,8 @@ class GajimApplication(Gtk.Application): jid, cmd = uri.split('?') if cmd == 'join': self.interface.join_gc_minimal(None, jid) + elif cmd == 'roster': + self.activate_action('add-contact', GLib.Variant('s', jid)) def do_shutdown(self, *args): Gtk.Application.do_shutdown(self) @@ -359,6 +361,10 @@ class GajimApplication(Gtk.Application): ('faq', action.on_faq), ] + act = Gio.SimpleAction.new('add-contact', GLib.VariantType.new('s')) + act.connect("activate", action.on_add_contact_jid) + self.add_action(act) + for action in self.general_actions: action_name, func = action act = Gio.SimpleAction.new(action_name, None)