[evolution-patches] (groupwise) minor changes in groupwise backend
- From: "Susarla Parthasarathi" <sparthasarathi novell com>
- To: <evolution-patches lists ximian com>
- Subject: [evolution-patches] (groupwise) minor changes in groupwise backend
- Date: Thu, 30 Jun 2005 23:54:54 -0600
Hi,
The attached patch contains the following changes with regard to the
groupwise provider:
* add mail size for summary display in evo
* support for 'threading' on the server when messages are
forwarded/replied to.
* support for Groupwise Notes in the mail view
cheers,
partha
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/ChangeLog,v
retrieving revision 1.141
diff -u -p -r1.141 ChangeLog
--- ChangeLog 8 Jun 2005 05:42:43 -0000 1.141
+++ ChangeLog 1 Jul 2005 05:49:32 -0000
@@ -1,3 +1,19 @@
+2005-07-01 Parthasarathi Susarla <sparthasarathi novell com>
+
+ * e-gw-connection.[ch] :
+ (e_gw_connection_forward_item):
+ * e-gw-item.[ch]:
+ added padding to 'struct _EGwItemPrivate'
+ (free_link_info):
+ (e_gw_item_new_from_soap_parameter):
+ Support for Groupwise Notes.
+ Adds size of the mail, for display in summary.
+ Support for message body > 64 K
+ Added linkInfo element for thread information to the server
+ (add_attachment_to_soap_message):
+ set itemReference in case of forwarded mails.
+
+
2005-06-08 Srinivasa Ragavan <sragavan novell com>
* e-gw-connection.[ch] :Added function to retrive deltainfo and delta
Index: e-gw-connection.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.c,v
retrieving revision 1.118
diff -u -p -r1.118 e-gw-connection.c
--- e-gw-connection.c 8 Jun 2005 05:42:43 -0000 1.118
+++ e-gw-connection.c 1 Jul 2005 05:49:33 -0000
@@ -2900,4 +2909,64 @@ e_gw_connection_reply_item (EGwConnectio
g_object_unref (msg);
return E_GW_CONNECTION_STATUS_OK;
+}
+
+EGwConnectionStatus
+e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *view, gboolean embed, EGwItem **item)
+{
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param;
+ g_print ("In here..\n");
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+
+ /* build the SOAP message */
+ msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "forwardRequest");
+ if (!msg) {
+ g_warning (G_STRLOC ": Could not build SOAP message");
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
+
+ e_gw_message_write_string_parameter (msg, "id", NULL, id);
+
+ if (view)
+ e_gw_message_write_string_parameter (msg, "view", NULL, view) ;
+
+ if (embed)
+ e_gw_message_write_int_parameter (msg, "embed", NULL,1);
+
+ e_gw_message_write_footer (msg);
+ /* send message to server */
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
+ reauthenticate (cnc);
+ g_object_unref (response);
+ g_object_unref (msg);
+ return status;
+ }
+
+ /* if status is OK - parse result. return the list */
+ param = soup_soap_response_get_first_parameter_by_name (response, "item");
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
+
+ *item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "", param);
+
+
+ /* free memory */
+ g_object_unref (response);
+ g_object_unref (msg);
+
+ return E_GW_CONNECTION_STATUS_OK;
}
Index: e-gw-connection.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-connection.h,v
retrieving revision 1.59
diff -u -p -r1.59 e-gw-connection.h
--- e-gw-connection.h 8 Jun 2005 05:42:43 -0000 1.59
+++ e-gw-connection.h 1 Jul 2005 05:49:33 -0000
@@ -147,6 +147,7 @@ EGwConnectionStatus e_gw_connection_purg
EGwConnectionStatus e_gw_connection_mark_read(EGwConnection *cnc, GList *item_ids) ;
EGwConnectionStatus e_gw_connection_mark_unread(EGwConnection *cnc, GList *item_ids) ;
EGwConnectionStatus e_gw_connection_reply_item (EGwConnection *cnc, const char *id, const char *view, EGwItem **item) ;
+EGwConnectionStatus e_gw_connection_forward_item (EGwConnection *cnc, const char *id, const char *view, gboolean embed, EGwItem **item);
G_END_DECLS
#endif
Index: e-gw-item.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.c,v
retrieving revision 1.82
diff -u -p -r1.82 e-gw-item.c
--- e-gw-item.c 8 Jun 2005 05:42:43 -0000 1.82
+++ e-gw-item.c 1 Jul 2005 05:49:34 -0000
@@ -57,15 +57,18 @@ struct _EGwItemPrivate {
GSList *recipient_list;
GSList *recurrence_dates;
int trigger; /* alarm */
+ int size; /*message size*/
EGwItemOrganizer *organizer;
/*properties for mail*/
char *from ;
char *to ;
char *content_type ;
+ char *msg_body_id;
int item_status;
- /*Attachments*/
- GSList *attach_list ;
+ gboolean has_attachment;
+ GSList *attach_list ; /*Attachments*/
+ EGwItemLinkInfo *link_info; /*linkInfo for replies*/
/* properties for tasks/calendars */
char *icalid;
@@ -113,6 +116,8 @@ struct _EGwItemPrivate {
GHashTable *additions;
GHashTable *updates;
GHashTable *deletions;
+ /*padding*/
+ unsigned int padding[10];
};
static GObjectClass *parent_class = NULL;
@@ -216,6 +221,21 @@ free_im_address ( gpointer address, gpoi
}
}
+static void
+free_link_info (EGwItemLinkInfo *info)
+{
+ if (info) {
+ if (info->id )
+ g_free (info->id), info->id = NULL;
+ if (info->type)
+ g_free (info->type), info->type = NULL;
+ if (info->thread)
+ g_free (info->thread), info->thread = NULL;
+ g_free (info);
+ info = NULL;
+ }
+}
+
static void
free_changes ( GHashTable *changes)
{
@@ -306,7 +326,11 @@ e_gw_item_dispose (GObject *object)
if (priv->content_type) {
g_free (priv->content_type) ;
- priv->to = NULL ;
+ priv->content_type = NULL ;
+ }
+ if (priv->msg_body_id) {
+ g_free (priv->msg_body_id);
+ priv->msg_body_id = NULL;
}
if (priv->icalid) {
@@ -386,6 +410,10 @@ e_gw_item_dispose (GObject *object)
g_free (priv->source);
priv->source = NULL;
}
+ if (priv->link_info) {
+ free_link_info (priv->link_info);
+ priv->link_info = NULL;
+ }
free_changes (priv->additions);
free_changes (priv->deletions);
free_changes (priv->updates);
@@ -462,6 +490,8 @@ e_gw_item_init (EGwItem *item, EGwItemCl
priv->updates = g_hash_table_new (g_str_hash, g_str_equal);
priv->deletions = g_hash_table_new (g_str_hash, g_str_equal);
priv->self_status = 0;
+ priv->link_info = NULL;
+ priv->msg_body_id = NULL;
item->priv = priv;
@@ -1565,6 +1595,8 @@ e_gw_item_new_from_soap_parameter (const
item->priv->item_type = E_GW_ITEM_TYPE_APPOINTMENT;
else if (!g_ascii_strcasecmp (item_type, "Task"))
item->priv->item_type = E_GW_ITEM_TYPE_TASK;
+ else if (!g_ascii_strcasecmp (item_type, "Note"))
+ item->priv->item_type = E_GW_ITEM_TYPE_NOTE;
else if (!g_ascii_strcasecmp (item_type, "Contact") ) {
item->priv->item_type = E_GW_ITEM_TYPE_CONTACT;
set_contact_fields_from_soap_parameter (item, param);
@@ -1716,18 +1748,22 @@ e_gw_item_new_from_soap_parameter (const
organizer->email = soup_soap_parameter_get_string_value (subparam);
e_gw_item_set_organizer (item, organizer);
}
+ } else if (!g_ascii_strcasecmp (name, "size")) {
+ item->priv->size = atoi(soup_soap_parameter_get_string_value (child));
+ } else if (!g_ascii_strcasecmp (name, "hasAttachment")){
+ e_gw_item_set_attach_status (item, TRUE);
} else if (!g_ascii_strcasecmp (name, "options")) {
SoupSoapParameter *subparam;
char *value = NULL;
-
subparam = soup_soap_parameter_get_first_child_by_name (child, "priority");
- if (subparam)
+ if (subparam) {
value = soup_soap_parameter_get_string_value (subparam);
- if (value)
- item->priv->priority = g_strdup (value);
-
- g_free (value), value = NULL;
+ if (value) {
+ e_gw_item_set_priority (item, value);
+ g_free (value), value = NULL;
+ }
+ }
subparam = soup_soap_parameter_get_first_child_by_name (child, "expires");
if (subparam)
@@ -1782,7 +1818,7 @@ e_gw_item_new_from_soap_parameter (const
}
}
- } else if (!g_ascii_strcasecmp (name, "id"))
+ } else if (!g_ascii_strcasecmp (name, "id"))
item->priv->id = soup_soap_parameter_get_string_value (child);
else if (!g_ascii_strcasecmp (name, "message")) {
@@ -1798,8 +1834,11 @@ e_gw_item_new_from_soap_parameter (const
if (msg && length) {
len = atoi (length);
item->priv->message = soup_base64_decode (msg, &len);
+ if (!(item->priv->message)) {
+ item->priv->msg_body_id = soup_soap_parameter_get_property (part, "id") ;
+ }
item->priv->content_type = soup_soap_parameter_get_property (part, "contentType") ;
- }
+ }
g_free (length);
g_free (msg);
@@ -1817,7 +1856,7 @@ e_gw_item_new_from_soap_parameter (const
attach->id = soup_soap_parameter_get_string_value (temp) ;
ref = soup_soap_parameter_get_property (temp, "itemReference");
if (ref) {
- attach->contentType = g_strdup_printf ("gw:%s",ref);
+ attach->item_reference = g_strdup (ref);
g_free (ref);
}
}
@@ -1869,9 +1908,21 @@ e_gw_item_new_from_soap_parameter (const
if (!strcmp (value, "personal"))
is_group_item = FALSE;
g_free (value);
- }
+ } else if (!g_ascii_strcasecmp (name, "link")){
+ SoupSoapParameter *temp;
+ EGwItemLinkInfo *info = g_new0 (EGwItemLinkInfo, 1);
+ temp = soup_soap_parameter_get_first_child_by_name (child, "id") ;
+ if (temp)
+ info->id = soup_soap_parameter_get_string_value (temp);
+ temp = soup_soap_parameter_get_first_child_by_name (child, "type") ;
+ if (temp)
+ info->type =soup_soap_parameter_get_string_value (temp);
+ temp = soup_soap_parameter_get_first_child_by_name (child, "thread") ;
+ if (temp)
+ info->thread =soup_soap_parameter_get_string_value (temp);
+ e_gw_item_set_link_info (item, info);
- else if (!g_ascii_strcasecmp (name, "alarm")) {
+ }else if (!g_ascii_strcasecmp (name, "alarm")) {
char *enabled;
enabled = soup_soap_parameter_get_property (child, "enabled");
if (!g_ascii_strcasecmp (enabled, "true") ) {
@@ -1959,6 +2010,13 @@ e_gw_item_set_id (EGwItem *item, const c
item->priv->id = g_strdup (new_id);
}
+int
+e_gw_item_get_mail_size (EGwItem *item)
+{
+ g_return_val_if_fail (E_IS_GW_ITEM (item), 0);
+ return item->priv->size;
+}
+
char *
e_gw_item_get_creation_date (EGwItem *item)
{
@@ -2175,7 +2233,6 @@ const char *
e_gw_item_get_priority (EGwItem *item)
{
g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
-
return (const char *) item->priv->priority;
}
@@ -2189,6 +2246,20 @@ e_gw_item_set_priority (EGwItem *item, c
item->priv->priority = g_strdup (new_priority);
}
+void
+e_gw_item_set_attach_status (EGwItem *item, gboolean has_attachment)
+{
+ g_return_if_fail (E_IS_GW_ITEM (item));
+ item->priv->has_attachment = has_attachment;
+}
+
+gboolean
+e_gw_item_get_attach_status (EGwItem *item)
+{
+ g_return_val_if_fail (E_IS_GW_ITEM (item), FALSE);
+ return item->priv->has_attachment;
+}
+
const char *
e_gw_item_get_task_priority (EGwItem *item)
{
@@ -2310,6 +2381,13 @@ e_gw_item_get_msg_content_type (EGwItem
return item->priv->content_type ;
}
+const char *
+e_gw_item_get_msg_body_id (EGwItem *item)
+{
+ g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
+ return item->priv->msg_body_id;
+}
+
void
e_gw_item_set_sendoptions (EGwItem *item, gboolean set)
{
@@ -2520,6 +2598,20 @@ e_gw_item_get_content_type (EGwItem *ite
return item->priv->content_type ;
}
+void
+e_gw_item_set_link_info (EGwItem *item, EGwItemLinkInfo *info)
+{
+ g_return_if_fail (E_IS_GW_ITEM (item));
+ item->priv->link_info = info;
+}
+
+EGwItemLinkInfo *
+e_gw_item_get_link_info (EGwItem *item)
+{
+ g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
+ return item->priv->link_info;
+}
+
static void
add_return_notification (SoupSoapMessage *msg, char *option, EGwItemReturnNotify value)
{
@@ -2678,10 +2770,12 @@ add_attachment_to_soap_message(EGwItemAt
soup_soap_message_start_element (msg, "attachment", NULL, NULL) ;
/*id*/
- if (attachment->id)
- e_gw_message_write_string_parameter (msg, "id", NULL, attachment->id) ;
+ if (attachment->id && attachment->item_reference)
+ e_gw_message_write_string_parameter_with_attribute (msg,"id", NULL, attachment->id, "itemReference", attachment->item_reference);
+ else if (attachment->id)
+ e_gw_message_write_string_parameter (msg, "id", NULL, attachment->id);
else
- e_gw_message_write_string_parameter (msg, "id", NULL, "") ;
+ e_gw_message_write_string_parameter (msg, "id", NULL, "");
/*name*/
e_gw_message_write_string_parameter (msg, "name", NULL, attachment->name) ;
/*content type*/
@@ -2854,13 +2948,22 @@ e_gw_item_append_to_soap_message (EGwIte
/*attachments*/
if (priv->attach_list) {
- soup_soap_message_start_element (msg, "attachments", NULL, NULL) ;
- GSList *al ;
+ GSList *al;
+ soup_soap_message_start_element (msg, "attachments", NULL, NULL);
for (al = priv->attach_list ; al != NULL ; al = al->next) {
- EGwItemAttachment *attachment = (EGwItemAttachment *)al->data ;
- add_attachment_to_soap_message (attachment, msg) ;
+ EGwItemAttachment *attachment = (EGwItemAttachment *)al->data;
+ add_attachment_to_soap_message (attachment, msg);
}
- soup_soap_message_end_element (msg) ;
+ soup_soap_message_end_element (msg);
+ }
+
+ /*Link info - used when a mail is being replied to or forwarded*/
+ if (priv->link_info) {
+ soup_soap_message_start_element (msg, "link", NULL, NULL);
+ e_gw_message_write_string_parameter (msg, "id", NULL, priv->link_info->id) ;
+ e_gw_message_write_string_parameter (msg, "type", NULL, priv->link_info->type) ;
+ e_gw_message_write_string_parameter (msg, "thread", NULL, priv->link_info->thread) ;
+ soup_soap_message_end_element (msg);
}
break;
Index: e-gw-item.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.h,v
retrieving revision 1.33
diff -u -p -r1.33 e-gw-item.h
--- e-gw-item.h 8 Jun 2005 05:42:43 -0000 1.33
+++ e-gw-item.h 1 Jul 2005 05:49:34 -0000
@@ -49,6 +49,7 @@ typedef enum {
E_GW_ITEM_TYPE_RESOURCE,
E_GW_ITEM_TYPE_CATEGORY,
E_GW_ITEM_TYPE_NOTIFICATION,
+ E_GW_ITEM_TYPE_NOTE,
E_GW_ITEM_TYPE_UNKNOWN
} EGwItemType;
@@ -122,6 +123,7 @@ typedef struct {
typedef struct {
char *id ;
char *name ;
+ char *item_reference;
char *contentType ;
int size ;
char *date ;
@@ -140,6 +142,12 @@ typedef enum {
E_GW_ITEM_ALL
} EGwItemTrack;
+typedef struct {
+ char *id;
+ char *type;
+ char *thread;
+} EGwItemLinkInfo;
+
GType e_gw_item_get_type (void);
EGwItem *e_gw_item_new_empty (void);
EGwItem *e_gw_item_new_from_soap_parameter (const char *email, const char *container, SoupSoapParameter *param);
@@ -191,7 +199,11 @@ const char* e_gw_item_get_to (EGwItem *i
const char *e_gw_item_get_msg_content_type (EGwItem *item) ;
guint32 e_gw_item_get_item_status (EGwItem *item);
void e_gw_item_set_content_type (EGwItem *item, const char *content_type) ;
+void e_gw_item_set_link_info (EGwItem *item, EGwItemLinkInfo *info);
+EGwItemLinkInfo *e_gw_item_get_link_info (EGwItem *item);
char *e_gw_item_get_content_type (EGwItem *item) ;
+const char *e_gw_item_get_msg_body_id (EGwItem *item);
+int e_gw_item_get_mail_size (EGwItem *item);
void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, char *field_name, gpointer field_value);
gboolean e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg);
void e_gw_item_set_category_name (EGwItem *item, char *cateogry_name);
@@ -242,6 +254,10 @@ void e_gw_item_set_accept_level (
const char *e_gw_item_get_priority (EGwItem *item);
void e_gw_item_set_priority (EGwItem *item, const char *new_priority);
+
+gboolean e_gw_item_get_attach_status (EGwItem *item);
+void e_gw_item_set_attach_status (EGwItem *item, gboolean has_attachment);
+
const char *e_gw_item_get_task_priority (EGwItem *item);
void e_gw_item_set_task_priority (EGwItem *item, const char *new_priority);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]