aboutsummaryrefslogtreecommitdiff
path: root/plugins/notification-sound/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/notification-sound/src')
-rw-r--r--plugins/notification-sound/src/plugin.vala20
-rw-r--r--plugins/notification-sound/src/register_plugin.vala3
2 files changed, 23 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() { }
+}
+
+}
diff --git a/plugins/notification-sound/src/register_plugin.vala b/plugins/notification-sound/src/register_plugin.vala
new file mode 100644
index 00000000..09204c0f
--- /dev/null
+++ b/plugins/notification-sound/src/register_plugin.vala
@@ -0,0 +1,3 @@
+public Type register_plugin(Module module) {
+ return typeof (Dino.Plugins.NotificationSound.Plugin);
+}