From 2b2b436f2d14d83c6fdbf0da75dd2cdfcf2dd48f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 19 Jun 2010 13:16:19 +0200 Subject: mobilesync: Fix incorrect process changes message when sending changes Sending changes from computer to device was broken. This also allows passing NULL for actions. --- src/mobilesync.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mobilesync.c') diff --git a/src/mobilesync.c b/src/mobilesync.c index 0d68c40..b7567f2 100644 --- a/src/mobilesync.c +++ b/src/mobilesync.c @@ -541,9 +541,14 @@ static plist_t create_process_changes_message(const char *data_class, plist_t en { plist_t msg = plist_new_array(); plist_array_append_item(msg, plist_new_string("SDMessageProcessChanges")); + plist_array_append_item(msg, plist_new_string(data_class)); plist_array_append_item(msg, plist_copy(entities)); plist_array_append_item(msg, plist_new_bool(more_changes)); - plist_array_append_item(msg, plist_copy(actions)); + + if (actions) + plist_array_append_item(msg, plist_copy(actions)); + else + plist_array_append_item(msg, plist_new_string(EMPTY_PARAMETER_STRING)); return msg; } @@ -631,7 +636,8 @@ mobilesync_error_t mobilesync_ready_to_send_changes_from_computer(mobilesync_cli * @param client The mobilesync client * @param entities The changed entity records as a PLIST_DICT * @param is_last_record A flag indiciating if this submission is the last one - * @param actions Additional flags for the device created with mobilesync_actions_new() + * @param actions Additional actions for the device created with mobilesync_actions_new() + * or NULL if no actions should be passed * * @return MOBILESYNC_E_SUCCESS on success, MOBILESYNC_E_INVALID_ARG if * one of the parameters is invalid, MOBILESYNC_E_WRONG_DIRECTION if the -- cgit v1.1-32-gdbae