daemon = e_dbus_object_data_get(obj);
- return e_notify_marshal_get_server_information_return(message, daemon->name, daemon->vendor, E_NOTIFICATION_DAEMON_VERSION);
+ return e_notify_marshal_get_server_information_return(message, daemon->name, daemon->vendor, E_NOTIFICATION_DAEMON_VERSION, E_NOTIFICATION_DAEMON_SUPPORTS_SPEC_VERSION);
}
e_dbus_interface_method_add(daemon->iface, "GetCapabilities", "", "as", method_get_capabilities);
e_dbus_interface_method_add(daemon->iface, "Notify", "susssasa{sv}i", "u", method_notify);
e_dbus_interface_method_add(daemon->iface, "CloseNotification", "u", "u", method_close_notification);
- e_dbus_interface_method_add(daemon->iface, "GetServerInformation", "", "sss", method_get_server_information);
+ e_dbus_interface_method_add(daemon->iface, "GetServerInformation", "", "ssss", method_get_server_information);
return daemon;
}
void * e_notify_unmarshal_get_capabilities_return(DBusMessage *msg, DBusError *err);
void e_notify_free_get_capabilities_return(void *data);
DBusMessage * e_notify_marshal_get_server_information();
-DBusMessage * e_notify_marshal_get_server_information_return(DBusMessage *method_call, const char *name, const char *vendor, const char *version);
+DBusMessage * e_notify_marshal_get_server_information_return(DBusMessage *method_call, const char *name, const char *vendor, const char *version, const char *spec_version);
void * e_notify_unmarshal_get_server_information_return(DBusMessage *msg, DBusError *err);
void e_notify_free_get_server_information_return(void *data);
DBusMessage * e_notify_marshal_close_notification(dbus_uint32_t id);
}
DBusMessage *
-e_notify_marshal_get_server_information_return(DBusMessage *method_call, const char *name, const char *vendor, const char *version)
+e_notify_marshal_get_server_information_return(DBusMessage *method_call, const char *name, const char *vendor, const char *version, const char *spec_version)
{
DBusMessage *msg;
msg = dbus_message_new_method_return(method_call);
- dbus_message_append_args(msg, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &vendor, DBUS_TYPE_STRING, &version, DBUS_TYPE_INVALID);
+ dbus_message_append_args(msg, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &vendor, DBUS_TYPE_STRING, &version, DBUS_TYPE_STRING, &spec_version, DBUS_TYPE_INVALID);
return msg;
}
e_notify_unmarshal_get_server_information_return(DBusMessage *msg, DBusError *err)
{
E_Notification_Return_Get_Server_Information *info;
- if (!dbus_message_has_signature(msg, "sss")) return NULL;
-
- info = calloc(1, sizeof(E_Notification_Return_Get_Server_Information));
- dbus_message_get_args(msg, err,
- DBUS_TYPE_STRING, &(info->name),
- DBUS_TYPE_STRING, &(info->vendor),
- DBUS_TYPE_STRING, &(info->version),
- DBUS_TYPE_INVALID
- );
+ if (dbus_message_has_signature(msg, "ssss"))
+ {
+ info = calloc(1, sizeof(E_Notification_Return_Get_Server_Information));
+ dbus_message_get_args(msg, err,
+ DBUS_TYPE_STRING, &(info->name),
+ DBUS_TYPE_STRING, &(info->vendor),
+ DBUS_TYPE_STRING, &(info->version),
+ DBUS_TYPE_STRING, &(info->spec_version),
+ DBUS_TYPE_INVALID
+ );
+ }
+ else if (dbus_message_has_signature(msg,"sss"))
+ {
+ // stay combatible with servers <= 0.9 spec
+ info = calloc(1, sizeof(E_Notification_Return_Get_Server_Information));
+ dbus_message_get_args(msg, err,
+ DBUS_TYPE_STRING, &(info->name),
+ DBUS_TYPE_STRING, &(info->vendor),
+ DBUS_TYPE_STRING, &(info->version),
+ DBUS_TYPE_INVALID
+ );
+ }
+ else
+ {
+ return NULL;
+ }
if (dbus_error_is_set(err))
{
free(info);
return NULL;
}
-
return info;
}