Avoid crash when using linphone/gtk with libnotify < 0.7.0

This commit is contained in:
Simon Morlat 2014-11-18 18:13:16 +01:00
parent 0cae72bf52
commit 9e87f9d217
2 changed files with 8 additions and 4 deletions

View file

@ -330,7 +330,6 @@ if test "$gtk_ui" = "true" ; then
AC_DEFINE([HAVE_NOTIFY1],[1],[NOTIFY1 support])
esac
else
NotifyNotification *n;
echo "Libnotify support is disabled."
fi
fi

View file

@ -1228,14 +1228,19 @@ static bool_t notify_actions_supported() {
}
static NotifyNotification* build_notification(const char *title, const char *body) {
const char *icon_path = linphone_gtk_get_ui_config("icon", LINPHONE_ICON);
GdkPixbuf *pbuf = create_pixbuf(icon_path);
NotifyNotification *n = notify_notification_new(title, body, NULL
#ifdef HAVE_NOTIFY1
,NULL
#endif
);
notify_notification_set_icon_from_pixbuf(n, pbuf);
#ifndef HAVE_NOTIFY1
{
const char *icon_path = linphone_gtk_get_ui_config("icon", LINPHONE_ICON);
GdkPixbuf *pbuf = create_pixbuf(icon_path);
/*with notify1, this function makes the notification crash the app with obscure dbus glib critical errors*/
notify_notification_set_icon_from_pixbuf(n, pbuf);
}
#endif
return n;
}