From 492baaf0845fee2495b9d181cd9fd50403eb61f8 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 22 Mar 2017 23:55:19 +0100 Subject: Add back on subscription request --- main/src/ui/notifications.vala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'main/src/ui/notifications.vala') diff --git a/main/src/ui/notifications.vala b/main/src/ui/notifications.vala index 18e33c56..3efa7dc7 100644 --- a/main/src/ui/notifications.vala +++ b/main/src/ui/notifications.vala @@ -3,7 +3,7 @@ using Xmpp; namespace Dino.Ui { -public class Notifications : GLib.Object { +public class Notifications : Object { private StreamInteractor stream_interactor; private Notify.Notification notification = new Notify.Notification("", null, null); @@ -38,6 +38,13 @@ public class Notifications : GLib.Object { notification.set_image_from_pixbuf((new AvatarGenerator(40, 40)).draw_jid(stream_interactor, jid, account)); notification.add_action("accept", "Accept", () => { stream_interactor.get_module(PresenceManager.IDENTITY).approve_subscription(account, jid); + + if (stream_interactor.get_module(RosterManager.IDENTITY).get_roster_item(account, jid) == null) { + AddConversation.Chat.AddContactDialog dialog = new AddConversation.Chat.AddContactDialog(stream_interactor); + dialog.jid = jid.bare_jid.to_string(); + dialog.account = account; + dialog.show(); + } try { notification.close(); } catch (Error error) { } -- cgit v1.2.3-54-g00ecf