diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-01-20 00:06:00 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-01-20 00:06:00 +0100 |
commit | c1bf762f56cc7234567aedae2791373c512dccc0 (patch) | |
tree | 5bd497250c1e64378c562d6172e01e2a49d0564a /modules | |
parent | 753a848f7865529cdb1c665db54b56612f441662 (diff) | |
parent | 00ce82ce3ad5a2a995b0118e7528d77dad0cb1a4 (diff) |
Merge pull request #108 from clehner/notifyfix
Fix notification-related things
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gtk/gtk_mod.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/modules/gtk/gtk_mod.c b/modules/gtk/gtk_mod.c index e7667fc..5e01882 100644 --- a/modules/gtk/gtk_mod.c +++ b/modules/gtk/gtk_mod.c @@ -180,7 +180,6 @@ static void menu_on_presence_set(GtkMenuItem *item, struct gtk_mod *mod) } -#ifdef USE_NOTIFICATIONS static void menu_on_incoming_call_answer(GtkMenuItem *menuItem, struct gtk_mod *mod) { @@ -197,7 +196,6 @@ static void menu_on_incoming_call_reject(GtkMenuItem *menuItem, denotify_incoming_call(mod, call); mqueue_push(mod->mq, MQ_HANGUP, call); } -#endif static GtkMenuItem *accounts_menu_add_item(struct gtk_mod *mod, @@ -310,9 +308,15 @@ static void notify_incoming_call(struct gtk_mod *mod, GtkWidget *menu_item; #if defined(USE_LIBNOTIFY) NotifyNotification *notification; -#endif -#if GLIB_CHECK_VERSION(2,40,0) + if (!notify_is_initted()) + return; + notification = notify_notification_new(title, msg, "baresip"); + notify_notification_set_urgency(notification, NOTIFY_URGENCY_CRITICAL); + notify_notification_show(notification, NULL); + g_object_unref(notification); + +#elif GLIB_CHECK_VERSION(2,40,0) char id[64]; GVariant *target; GNotification *notification = g_notification_new(title); @@ -336,14 +340,6 @@ static void notify_incoming_call(struct gtk_mod *mod, g_application_send_notification(mod->app, id, notification); g_object_unref(notification); -#elif defined(USE_LIBNOTIFY) - /* If glib does not have GNotification, use libnotify instead. */ - if (!notify_is_initted()) - return; - notification = notify_notification_new(title, msg, "baresip"); - notify_notification_set_urgency(notification, NOTIFY_URGENCY_CRITICAL); - notify_notification_show(notification, NULL); - g_object_unref(notification); #else (void)msg; (void)title; @@ -496,11 +492,9 @@ static void ua_event_handler(struct ua *ua, accounts_menu_set_status(mod, ua, ev); break; -#ifdef USE_NOTIFICATIONS case UA_EVENT_CALL_INCOMING: notify_incoming_call(mod, call); break; -#endif case UA_EVENT_CALL_CLOSED: win = get_call_window(mod, call); |