diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-22 23:55:19 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-23 15:43:20 +0100 |
commit | 492baaf0845fee2495b9d181cd9fd50403eb61f8 (patch) | |
tree | 2d40fdcc5b86dfc1429fb660b2cfbc65b8a8f96b /main/src/ui/notifications.vala | |
parent | fa78573b052693b29350bdd0f7eaf74dc6571e4a (diff) | |
download | dino-492baaf0845fee2495b9d181cd9fd50403eb61f8.tar.gz dino-492baaf0845fee2495b9d181cd9fd50403eb61f8.zip |
Add back on subscription request
Diffstat (limited to 'main/src/ui/notifications.vala')
-rw-r--r-- | main/src/ui/notifications.vala | 9 |
1 files changed, 8 insertions, 1 deletions
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) { } |