diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-19 12:55:36 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-20 22:28:27 +0100 |
commit | db57a973534f099af2b150f1a1307d1948553d9f (patch) | |
tree | 238ae1d4e53412a33e3febd07318dfd38b0eb2f8 /main/src/ui/notifications.vala | |
parent | 233f2b35d033cd20d1ac648bf2d723bcb7a918fc (diff) | |
download | dino-db57a973534f099af2b150f1a1307d1948553d9f.tar.gz dino-db57a973534f099af2b150f1a1307d1948553d9f.zip |
Add typed identity to manager modules and stream flags
Diffstat (limited to 'main/src/ui/notifications.vala')
-rw-r--r-- | main/src/ui/notifications.vala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/src/ui/notifications.vala b/main/src/ui/notifications.vala index 17636995..18e33c56 100644 --- a/main/src/ui/notifications.vala +++ b/main/src/ui/notifications.vala @@ -13,14 +13,14 @@ public class Notifications : GLib.Object { } public void start() { - MessageManager.get_instance(stream_interactor).message_received.connect(on_message_received); - PresenceManager.get_instance(stream_interactor).received_subscription_request.connect(on_received_subscription_request); + stream_interactor.get_module(MessageManager.IDENTITY).message_received.connect(on_message_received); + stream_interactor.get_module(PresenceManager.IDENTITY).received_subscription_request.connect(on_received_subscription_request); } private void on_message_received(Entities.Message message, Conversation conversation) { - if (!ChatInteraction.get_instance(stream_interactor).is_active_focus()) { + if (!stream_interactor.get_module(ChatInteraction.IDENTITY).is_active_focus()) { string display_name = Util.get_conversation_display_name(stream_interactor, conversation); - if (MucManager.get_instance(stream_interactor).is_groupchat(conversation.counterpart, conversation.account)) { + if (stream_interactor.get_module(MucManager.IDENTITY).is_groupchat(conversation.counterpart, conversation.account)) { string muc_occupant = Util.get_display_name(stream_interactor, message.from, conversation.account); display_name = muc_occupant + " in " + display_name; } @@ -37,13 +37,13 @@ public class Notifications : GLib.Object { Notify.Notification notification = new Notify.Notification("Subscription request", jid.bare_jid.to_string(), null); notification.set_image_from_pixbuf((new AvatarGenerator(40, 40)).draw_jid(stream_interactor, jid, account)); notification.add_action("accept", "Accept", () => { - PresenceManager.get_instance(stream_interactor).approve_subscription(account, jid); + stream_interactor.get_module(PresenceManager.IDENTITY).approve_subscription(account, jid); try { notification.close(); } catch (Error error) { } }); notification.add_action("deny", "Deny", () => { - PresenceManager.get_instance(stream_interactor).deny_subscription(account, jid); + stream_interactor.get_module(PresenceManager.IDENTITY).deny_subscription(account, jid); try { notification.close(); } catch (Error error) { } |