From c43bfe3ebb9c0f98c143b8b3e777058d5c1c11e3 Mon Sep 17 00:00:00 2001
From: Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>
Date: Tue, 8 Sep 2020 05:10:11 +0200
Subject: [PATCH] src/calls-notifier.c: Add call-back button

---
 src/calls-notifier.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/calls-notifier.c b/src/calls-notifier.c
index 292c5598..076e2c60 100644
--- a/src/calls-notifier.c
+++ b/src/calls-notifier.c
@@ -46,6 +46,7 @@ notify (CallsNotifier *self, CallsCall *call)
   g_autoptr(GNotification) notification;
   g_autofree gchar *msg = NULL;
   g_autofree gchar *ref = NULL;
+  g_autofree gchar *label_callback = NULL;
   const char *name;
 
   notification = g_notification_new (_("Missed call"));
@@ -57,6 +58,12 @@ notify (CallsNotifier *self, CallsCall *call)
     msg = g_strdup_printf (_("Missed call from %s"), calls_call_get_number (call));
 
   g_notification_set_body (notification, msg);
+
+  if (calls_call_get_number (call)) {
+    label_callback = g_strdup_printf ("app.dial::%s", calls_call_get_number (call));
+    g_notification_add_button (notification, _("Call back"), label_callback);
+  }
+
   ref = g_strdup_printf ("missed-call-%s", calls_call_get_number (call) ?: "unknown");
   g_application_send_notification (app, ref, notification);
 }
-- 
GitLab