diff --git a/SPECIFICATION b/SPECIFICATION index 661b0ad..513f937 100644 --- a/SPECIFICATION +++ b/SPECIFICATION @@ -246,7 +246,9 @@ The following messages must be supported by all implementations. code. This code will be reported back to the client if the action is invoked by the user. - UINT32/NIL expire time: if nil the notification never times out + UINT32/NIL expire time: if nil the notification never times out. + If non-nil, a UNIX time_t (since the epoch) at which point the notification + will be automatically closed. If zero, use the default server timeout. It returns a UINT32 that will never be reused within a session unless more than MAXINT notifications have been generated diff --git a/tools/notify-send.c b/tools/notify-send.c index bafb12d..f1f11ce 100644 --- a/tools/notify-send.c +++ b/tools/notify-send.c @@ -38,7 +38,7 @@ main(int argc, const char **argv) gchar *icon_str = NULL; NotifyIcon *icon = NULL; NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL; - time_t expire_time; + time_t expire_time = 0; char ch; poptContext opt_ctx; const char **args; @@ -128,8 +128,8 @@ main(int argc, const char **argv) } /* if the given time is < current time, treat it as a timeout in seconds (ie 5 seconds) */ - if (expire_time < time(NULL)) expire_time += time(NULL); - + if (expire_time && expire_time < time(NULL)) expire_time += time(NULL); + notify_send_notification(0, urgency, summary, description, icon, TRUE, expire_time, NULL, 0);