diff options
author | fiaxh <git@lightrise.org> | 2021-03-19 23:09:56 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-03-21 12:41:39 +0100 |
commit | 0f46facecd558786631c2ad4cf66d27331f16a86 (patch) | |
tree | 74ba0d120dabbaf55e204cca5355022f3c3ba60e /main/src/ui/notifier_gnotifications.vala | |
parent | cdb4d77259e6c361aaca64a483a43d7441f4803d (diff) | |
download | dino-0f46facecd558786631c2ad4cf66d27331f16a86.tar.gz dino-0f46facecd558786631c2ad4cf66d27331f16a86.zip |
Add UI for audio/video 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()); |