mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-12 15:47:35 +00:00
src/calls-notifier.c: Add call-back button
This commit is contained in:
parent
baf1e4a652
commit
c43bfe3ebb
1 changed files with 7 additions and 0 deletions
|
@ -46,6 +46,7 @@ notify (CallsNotifier *self, CallsCall *call)
|
||||||
g_autoptr(GNotification) notification;
|
g_autoptr(GNotification) notification;
|
||||||
g_autofree gchar *msg = NULL;
|
g_autofree gchar *msg = NULL;
|
||||||
g_autofree gchar *ref = NULL;
|
g_autofree gchar *ref = NULL;
|
||||||
|
g_autofree gchar *label_callback = NULL;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
notification = g_notification_new (_("Missed call"));
|
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));
|
msg = g_strdup_printf (_("Missed call from %s"), calls_call_get_number (call));
|
||||||
|
|
||||||
g_notification_set_body (notification, msg);
|
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");
|
ref = g_strdup_printf ("missed-call-%s", calls_call_get_number (call) ?: "unknown");
|
||||||
g_application_send_notification (app, ref, notification);
|
g_application_send_notification (app, ref, notification);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue