summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2005-04-01 17:30:08 +0000
committerChristian Hammond <chipx86@chipx86.com>2005-04-01 17:30:08 +0000
commit88afc98c6ec2fa7dc7d46a4a33c9eeee9b782088 (patch)
tree07e4b91bf651c6c0a7c347fea2dcb328ca4aefdd
parentd8c0864049501507bc76d830beb278dc9f7b43b7 (diff)
downloadlibnotify-88afc98c6ec2fa7dc7d46a4a33c9eeee9b782088.tar.gz
Updated for the 0.6 notification spec.
-rw-r--r--ChangeLog5
-rw-r--r--libnotify/notify.c25
2 files changed, 14 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 401d23b..7b6c94a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* libnotify/notify.h:
diff --git a/libnotify/notify.c b/libnotify/notify.c
index 2555d1d..a152aa1 100644
--- a/libnotify/notify.c
+++ b/libnotify/notify.c
@@ -158,15 +158,12 @@ _notify_dbus_message_new(const char *name, DBusMessageIter *iter)
}
static void
-_notify_dbus_message_iter_append_string_or_nil(DBusMessageIter *iter,
- const char *str)
+_notify_dbus_message_iter_append_string_or_empty(DBusMessageIter *iter,
+ const char *str)
{
g_return_if_fail(iter != NULL);
- if (str == NULL)
- dbus_message_iter_append_nil(iter);
- else
- dbus_message_iter_append_string(iter, str);
+ dbus_message_iter_append_string(iter, (str != NULL ? str : ""));
}
static DBusHandlerResult
@@ -653,22 +650,18 @@ notify_send_notification_varg(NotifyHandle *replaces, const char *type,
g_return_val_if_fail(message != NULL, NULL);
- _notify_dbus_message_iter_append_string_or_nil(&iter, _app_name);
- dbus_message_iter_append_nil(&iter);
+ _notify_dbus_message_iter_append_string_or_empty(&iter, _app_name);
+ dbus_message_iter_append_string(&iter, "");
dbus_message_iter_append_uint32(&iter,
(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_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)
{
- dbus_message_iter_append_nil(&iter);
+ dbus_message_iter_append_string(&iter, "");
}
else if (icon->raw_data)
{
@@ -719,7 +712,7 @@ notify_send_notification_varg(NotifyHandle *replaces, const char *type,
}
/* Hints */
- dbus_message_iter_append_nil(&iter);
+ dbus_message_iter_append_dict(&iter, &dict_iter);
/* Expires */
dbus_message_iter_append_boolean(&iter, expires);