Handle ?roster uris

This commit is contained in:
Philipp Hörist 2017-11-30 19:47:39 +01:00
parent ace904573a
commit 010b166fd2
2 changed files with 11 additions and 0 deletions

View File

@ -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):

View File

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