WIP call notifications
This commit is contained in:
parent
bfff1a2e51
commit
9214e31b98
|
@ -96,7 +96,8 @@ public class NotificationEvents : StreamInteractionModule, Object {
|
|||
}
|
||||
break;
|
||||
case CallItem.TYPE:
|
||||
// handled in `on_call_incoming`
|
||||
// Also handled in `on_call_incoming`
|
||||
notify_content_item(item, conversation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,9 +8,35 @@ public class Plugin : RootInterface, Object {
|
|||
public void registered(Dino.Application app) {
|
||||
this.app = app;
|
||||
Canberra.Context.create(out sound_context);
|
||||
string sound_id = "",
|
||||
description = "Unknown notification";
|
||||
|
||||
app.stream_interactor.get_module(NotificationEvents.IDENTITY).notify_content_item.connect((item, conversation) => {
|
||||
sound_context.play(0, Canberra.PROP_EVENT_ID, "message-new-instant", Canberra.PROP_EVENT_DESCRIPTION, "New Dino message");
|
||||
var? module = app.stream_interactor.get_module(NotificationEvents.IDENTITY);
|
||||
|
||||
if (module == null)
|
||||
return;
|
||||
|
||||
module.notify_content_item.connect((item, conversation) => {
|
||||
switch (item.type_) {
|
||||
case MessageItem.TYPE:
|
||||
description = "New Dino message";
|
||||
sound_id = "message-new-instant";
|
||||
break;
|
||||
case CallItem.TYPE:
|
||||
description = "Incoming call";
|
||||
sound_id = "phone-incoming-call";
|
||||
break;
|
||||
case FileItem.TYPE:
|
||||
description = "Incoming file";
|
||||
sound_id = "message-new-instant";
|
||||
break;
|
||||
}
|
||||
|
||||
sound_context.play(0,
|
||||
Canberra.PROP_EVENT_ID,
|
||||
sound_id,
|
||||
Canberra.PROP_EVENT_DESCRIPTION,
|
||||
description);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue