diff options
author | fiaxh <git@lightrise.org> | 2021-05-11 12:57:02 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-05-11 12:57:02 +0200 |
commit | d71604913dd5b3372a823320db83c37c845fac5c (patch) | |
tree | 2ffbff97a02c81d48d8aef4a4b7ee870507236e9 /main/src/ui/notifier_gnotifications.vala | |
parent | e92ed27317ae398c867c946cf7206b1f0b32f3b4 (diff) | |
parent | 90f9ecf62b2ebfef14de2874e7942552409632bf (diff) | |
download | dino-d71604913dd5b3372a823320db83c37c845fac5c.tar.gz dino-d71604913dd5b3372a823320db83c37c845fac5c.zip |
Merge remote-tracking branch 'origin/feature/calls'
Diffstat (limited to 'main/src/ui/notifier_gnotifications.vala')
-rw-r--r-- | main/src/ui/notifier_gnotifications.vala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/main/src/ui/notifier_gnotifications.vala b/main/src/ui/notifier_gnotifications.vala index 31d1ffa3..5fd3be4b 100644 --- a/main/src/ui/notifier_gnotifications.vala +++ b/main/src/ui/notifier_gnotifications.vala @@ -65,6 +65,25 @@ namespace Dino.Ui { } } + public async void notify_call(Call call, Conversation conversation, bool video, string conversation_display_name) { + Notification notification = new Notification(conversation_display_name); + string body = _("Incoming call"); + notification.set_body(body); + notification.set_urgent(true); + + notification.set_icon(new ThemedIcon.from_names(new string[] {"call-start-symbolic"})); + + notification.set_default_action_and_target_value("app.open-conversation", new Variant.int32(conversation.id)); + notification.add_button_with_target_value(_("Deny"), "app.deny-call", new Variant.int32(call.id)); + notification.add_button_with_target_value(_("Accept"), "app.accept-call", new Variant.int32(call.id)); + + GLib.Application.get_default().send_notification(call.id.to_string(), notification); + } + + private async void retract_call_notification(Call call, Conversation conversation) { + GLib.Application.get_default().withdraw_notification(call.id.to_string()); + } + public async void notify_subscription_request(Conversation conversation) { Notification notification = new Notification(_("Subscription request")); notification.set_body(conversation.counterpart.to_string()); |