diff options
author | fiaxh <git@mx.ax.lt> | 2018-03-02 13:13:15 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2018-03-05 15:43:02 +0100 |
commit | a8ee61b34c4c6c73cda94ac5f60529e892b3666b (patch) | |
tree | 5f23d21dde98505eeca74490d3364be9d612e35a /plugins/notification-sound/src/plugin.vala | |
parent | 08c8b9c6d63784f3db1fa3423e629db3ca461b94 (diff) | |
download | dino-a8ee61b34c4c6c73cda94ac5f60529e892b3666b.tar.gz dino-a8ee61b34c4c6c73cda94ac5f60529e892b3666b.zip |
Move notification sounds (canberra dependency) into plugin, introduce libdino/NotificationEvents
Diffstat (limited to 'plugins/notification-sound/src/plugin.vala')
-rw-r--r-- | plugins/notification-sound/src/plugin.vala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/notification-sound/src/plugin.vala b/plugins/notification-sound/src/plugin.vala new file mode 100644 index 00000000..ba251434 --- /dev/null +++ b/plugins/notification-sound/src/plugin.vala @@ -0,0 +1,20 @@ +namespace Dino.Plugins.NotificationSound { + +public class Plugin : RootInterface, Object { + + public Dino.Application app; + private Canberra.Context sound_context; + + public void registered(Dino.Application app) { + this.app = app; + Canberra.Context.create(out sound_context); + + app.stream_interactor.get_module(NotificationEvents.IDENTITY).notify_message.connect((message, conversation) => { + sound_context.play(0, Canberra.PROP_EVENT_ID, "message-new-instant", Canberra.PROP_EVENT_DESCRIPTION, "New Dino message"); + }); + } + + public void shutdown() { } +} + +} |