+2005-06-06 Chenthill Palanisamy <pchenthill@novell.com>
+
+ * e-gw-connection.[ch] (e_gw_connection_delegate_request): Added a function for sending a delegate request.
+ * e-gw-item.h (add_distribution_to_soap_message): Changed the na
+ me and made it public.
+ * e-gw-item.c (e_gw_item_set_calendar_item_elements),
+ (e_gw_item_append_to_soap_message): Changed the name of the
+ above mentioned function.
+
2005-05-12 Harish Krishnaswamy <kharish@novell.com>
* libegroupwise.pc.in: Remove hardcoded value.
return status;
}
+EGwConnectionStatus
+e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char *id, const char *comments_org, const char *comments_del, const char *recur_key)
+{
+ SoupSoapMessage *msg;
+ int status;
+ SoupSoapResponse *response;
+
+ msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "delegateRequest");
+
+ if (id)
+ e_gw_message_write_string_parameter (msg, "id", NULL, id);
+
+ e_gw_item_add_distribution_to_soap_message (item, msg);
+ if (comments_org)
+ e_gw_message_write_string_parameter (msg, "commentToOrganizer", NULL, comments_org);
+ if (comments_del)
+ e_gw_message_write_string_parameter (msg, "commentToDelegatee", NULL, comments_del);
+ if (recur_key)
+ e_gw_message_write_string_parameter (msg, "recurrenceAllInstances", NULL, recur_key);
+
+ e_gw_message_write_footer (msg);
+
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ reauthenticate (cnc);
+
+ g_object_unref (response);
+ g_object_unref (msg);
+
+ return status;
+}
+
const char *
e_gw_connection_get_version (EGwConnection *cnc)
{
EGwConnectionStatus e_gw_connection_decline_request (EGwConnection *cnc, const char *id);
EGwConnectionStatus e_gw_connection_retract_request (EGwConnection *cnc, const char *id, const char *comment, gboolean retract_all, gboolean resend);
EGwConnectionStatus e_gw_connection_complete_request (EGwConnection *cnc, const char *id);
+EGwConnectionStatus e_gw_connection_delegate_request (EGwConnection *cnc, EGwItem *item, const char *id, const char *comments_org, const char *comments_del, const char *recur_key);
EGwConnectionStatus e_gw_connection_create_book (EGwConnection *cnc, char *book_name, char**id);
EGwConnectionStatus e_gw_connection_remove_book (EGwConnection *cnc, char *book_uid);
EGwConnectionStatus e_gw_connection_get_address_book_list (EGwConnection *cnc, GList **container_list);
soup_soap_message_end_element (msg);
}
-static void
-add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
+void
+e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg)
{
GSList *rl;
EGwItemPrivate *priv;
/* add each recipient */
for (rl = recipient_list; rl != NULL; rl = rl->next) {
char *dist_type;
- char *status;
+ char *status = NULL;
EGwItemRecipient *recipient = (EGwItemRecipient *) rl->data;
status = "declined";
else
status = "";
- e_gw_message_write_string_parameter (msg, "recipientStatus", NULL, status);
+ if (status && *status)
+ e_gw_message_write_string_parameter (msg, "recipientStatus", NULL, status);
soup_soap_message_end_element (msg);
}
e_gw_message_write_string_parameter (msg, "subject", NULL, priv->subject ? priv->subject : "");
if (priv->recipient_list != NULL) {
- add_distribution_to_soap_message (item, msg);
+ e_gw_item_add_distribution_to_soap_message (item, msg);
if (priv->set_sendoptions)
append_gw_item_options (msg, item);
}
if (priv->subject)
e_gw_message_write_string_parameter (msg, "subject", NULL, priv->subject) ;
/*distribution*/
- add_distribution_to_soap_message(item, msg) ;
+ e_gw_item_add_distribution_to_soap_message(item, msg) ;
if (priv->set_sendoptions) {
/* item options */
} EGwItemRecipient;
gboolean e_gw_item_append_to_soap_message (EGwItem *item, SoupSoapMessage *msg);
-
+void e_gw_item_add_distribution_to_soap_message (EGwItem *item, SoupSoapMessage *msg);
G_END_DECLS
#endif