diff --git a/bindings/vapi/libnotify.vapi b/bindings/vapi/libnotify.vapi index c5a67511..163cff16 100644 --- a/bindings/vapi/libnotify.vapi +++ b/bindings/vapi/libnotify.vapi @@ -59,7 +59,7 @@ namespace Notify { [CCode (cheader_filename = "libnotify/notify.h")] public static unowned string get_app_name (); [CCode (cheader_filename = "libnotify/notify.h")] - public static GLib.List get_server_caps (); + public static GLib.List? get_server_caps (); [CCode (cheader_filename = "libnotify/notify.h")] public static bool get_server_info (out unowned string ret_name, out unowned string ret_vendor, out unowned string ret_version, out unowned string ret_spec_version); [CCode (cheader_filename = "libnotify/notify.h")] diff --git a/src/client/notification/libnotify.vala b/src/client/notification/libnotify.vala index bb252688..3f405e0f 100644 --- a/src/client/notification/libnotify.vala +++ b/src/client/notification/libnotify.vala @@ -16,7 +16,7 @@ public class Libnotify : Geary.BaseObject { private Notify.Notification? error_notification = null; private Geary.Folder? folder = null; private Geary.Email? email = null; - private List caps; + private List? caps = null; public signal void invoked(Geary.Folder? folder, Geary.Email? email); @@ -31,8 +31,10 @@ public class Libnotify : Geary.BaseObject { } init_sound(); - caps = Notify.get_server_caps(); + // This will return null if no notification server is present + this.caps = Notify.get_server_caps(); + monitor.new_messages_arrived.connect(on_new_messages_arrived); } @@ -148,8 +150,11 @@ public class Libnotify : Geary.BaseObject { } - private Notify.Notification issue_notification(string category, string summary, + private Notify.Notification? issue_notification(string category, string summary, string body, Gdk.Pixbuf? icon, string? sound) { + if (this.caps == null) + return null; + // Avoid constructor due to ABI change Notify.Notification notification = (Notify.Notification) GLib.Object.new( typeof (Notify.Notification),