+2004-03-22 Rodrigo Moya <rodrigo@ximian.com>
+
+ * e-gw-connection.[ch] (e_gw_connection_send_item): added 'char **id'
+ parameter to pass the server-generated ID to the caller. Get the ID from
+ the sendItemResponse message.
+
2004-03-19 JP Rosevear <jpr@ximian.com>
* e-gw-connection.c:
}
EGwConnectionStatus
-e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item)
+e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item, char **id)
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
g_return_val_if_fail (E_IS_GW_ITEM (item), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ if (id)
+ *id = NULL;
+
/* compose SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "sendItemRequest");
if (!msg) {
}
status = e_gw_connection_parse_response_status (response);
+ if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
+ SoupSoapParameter *param;
+
+ /* get the generated ID from the SOAP response */
+ param = soup_soap_response_get_first_parameter_by_name (response, "id");
+ if (param)
+ *id = soup_soap_parameter_get_string_value (param);
+ }
g_object_unref (msg);
g_object_unref (response);
EGwConnectionStatus e_gw_connection_get_items (EGwConnection *cnc, const char *container,
const char *view, EGwFilter *filter, GList **list);
EGwConnectionStatus e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes, GSList **updates);
-EGwConnectionStatus e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item);
+EGwConnectionStatus e_gw_connection_send_item (EGwConnection *cnc, EGwItem *item, char **id);
EGwConnectionStatus e_gw_connection_remove_item (EGwConnection *cnc, const char *container, const char *id);
const char *e_gw_connection_get_uri (EGwConnection *cnc);