Updated for the 0.6 notification spec.
This commit is contained in:
parent
d8c0864049
commit
88afc98c6e
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Apr 01 09:21:26 PST 2005 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
|
* libnotify/notify.c:
|
||||||
|
- Updated to work with 0.6 of the notification spec.
|
||||||
|
|
||||||
Sat Nov 06 15:40:48 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
Sat Nov 06 15:40:48 PST 2004 Christian Hammond <chipx86@gnupdate.org>
|
||||||
|
|
||||||
* libnotify/notify.h:
|
* libnotify/notify.h:
|
||||||
|
|
|
@ -158,15 +158,12 @@ _notify_dbus_message_new(const char *name, DBusMessageIter *iter)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_notify_dbus_message_iter_append_string_or_nil(DBusMessageIter *iter,
|
_notify_dbus_message_iter_append_string_or_empty(DBusMessageIter *iter,
|
||||||
const char *str)
|
const char *str)
|
||||||
{
|
{
|
||||||
g_return_if_fail(iter != NULL);
|
g_return_if_fail(iter != NULL);
|
||||||
|
|
||||||
if (str == NULL)
|
dbus_message_iter_append_string(iter, (str != NULL ? str : ""));
|
||||||
dbus_message_iter_append_nil(iter);
|
|
||||||
else
|
|
||||||
dbus_message_iter_append_string(iter, str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static DBusHandlerResult
|
static DBusHandlerResult
|
||||||
|
@ -653,22 +650,18 @@ notify_send_notification_varg(NotifyHandle *replaces, const char *type,
|
||||||
|
|
||||||
g_return_val_if_fail(message != NULL, NULL);
|
g_return_val_if_fail(message != NULL, NULL);
|
||||||
|
|
||||||
_notify_dbus_message_iter_append_string_or_nil(&iter, _app_name);
|
_notify_dbus_message_iter_append_string_or_empty(&iter, _app_name);
|
||||||
dbus_message_iter_append_nil(&iter);
|
dbus_message_iter_append_string(&iter, "");
|
||||||
dbus_message_iter_append_uint32(&iter,
|
dbus_message_iter_append_uint32(&iter,
|
||||||
(replaces != NULL ? replaces->id : 0));
|
(replaces != NULL ? replaces->id : 0));
|
||||||
_notify_dbus_message_iter_append_string_or_nil(&iter, type);
|
_notify_dbus_message_iter_append_string_or_empty(&iter, type);
|
||||||
dbus_message_iter_append_byte(&iter, urgency);
|
dbus_message_iter_append_byte(&iter, urgency);
|
||||||
dbus_message_iter_append_string(&iter, summary);
|
dbus_message_iter_append_string(&iter, summary);
|
||||||
_notify_dbus_message_iter_append_string_or_nil(&iter, body);
|
_notify_dbus_message_iter_append_string_or_empty(&iter, body);
|
||||||
|
|
||||||
/*
|
|
||||||
* NOTE: D-BUS 0.22cvs is the first to allow empty arrays, *I think*.
|
|
||||||
* For now, allow a NIL.
|
|
||||||
*/
|
|
||||||
if (icon == NULL)
|
if (icon == NULL)
|
||||||
{
|
{
|
||||||
dbus_message_iter_append_nil(&iter);
|
dbus_message_iter_append_string(&iter, "");
|
||||||
}
|
}
|
||||||
else if (icon->raw_data)
|
else if (icon->raw_data)
|
||||||
{
|
{
|
||||||
|
@ -719,7 +712,7 @@ notify_send_notification_varg(NotifyHandle *replaces, const char *type,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hints */
|
/* Hints */
|
||||||
dbus_message_iter_append_nil(&iter);
|
dbus_message_iter_append_dict(&iter, &dict_iter);
|
||||||
|
|
||||||
/* Expires */
|
/* Expires */
|
||||||
dbus_message_iter_append_boolean(&iter, expires);
|
dbus_message_iter_append_boolean(&iter, expires);
|
||||||
|
|
Loading…
Reference in New Issue