X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fnotify_desktop.c;h=3f3c6dfc9bf62c3ac0dc356295f0e68faf5879a8;hb=a02ced789b4c93f293dc9d14a5a303c5fe11bcce;hp=2e62e88c46fa61c3ea3b5200524d88fdb12ac779;hpb=074b4980bc75bea6826e6a38dcc6e193a721b2a8;p=collectd.git diff --git a/src/notify_desktop.c b/src/notify_desktop.c index 2e62e88c..3f3c6dfc 100644 --- a/src/notify_desktop.c +++ b/src/notify_desktop.c @@ -31,6 +31,10 @@ #include #include +#ifndef NOTIFY_CHECK_VERSION +# define NOTIFY_CHECK_VERSION(x,y,z) 0 +#endif + #define log_info(...) INFO ("notify_desktop: " __VA_ARGS__) #define log_warn(...) WARNING ("notify_desktop: " __VA_ARGS__) #define log_err(...) ERROR ("notify_desktop: " __VA_ARGS__) @@ -72,7 +76,8 @@ static int c_notify_config (oconfig_item_t *ci) return 0; } /* c_notify_config */ -static int c_notify (const notification_t *n) +static int c_notify (const notification_t *n, + user_data_t __attribute__((unused)) *user_data) { NotifyNotification *notification = NULL; NotifyUrgency urgency = NOTIFY_URGENCY_LOW; @@ -94,7 +99,12 @@ static int c_notify (const notification_t *n) : (NOTIF_WARNING == n->severity) ? "WARNING" : (NOTIF_OKAY == n->severity) ? "OKAY" : "UNKNOWN"); - notification = notify_notification_new (summary, n->message, NULL, NULL); + notification = notify_notification_new (summary, n->message, NULL +#if NOTIFY_CHECK_VERSION (0, 7, 0) + ); +#else + , NULL); +#endif if (NULL == notification) { log_err ("Failed to create a new notification."); return -1; @@ -145,7 +155,8 @@ static int c_notify_init (void) free (spec_version); } - plugin_register_notification ("notify_desktop", c_notify); + plugin_register_notification ("notify_desktop", c_notify, + /* user_data = */ NULL); plugin_register_shutdown ("notify_desktop", c_notify_shutdown); return 0; } /* c_notify_init */