evolution-data-server r9240 - in branches/EXCHANGE_MAPI_BRANCH: camel/providers/mapi servers/mapi



Author: msuman
Date: Thu Jul 31 11:30:57 2008
New Revision: 9240
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9240&view=rev

Log:
MAPI - Added props for external recipients in mailer code.

Modified:
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-transport.c
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c

Modified: branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-transport.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-transport.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/camel/providers/mapi/camel-mapi-transport.c	Thu Jul 31 11:30:57 2008
@@ -391,6 +391,9 @@
 static void
 mapi_item_add_recipient (const char *recipients, OlMailRecipientType type, GSList **recipient_list)
 {
+	uint32_t val = 0;
+	const char *str = NULL;
+
 	if (!recipients)
 		return ;
 
@@ -404,6 +407,20 @@
 	recipient->in.req_cValues = 1;
 	set_SPropValue_proptag (&(recipient->in.req_lpProps[0]), PR_RECIPIENT_TYPE, (const void *) &type);
 
+	/* External recipient properties - set them only when the recipient is unresolved */
+	recipient->in.ext_lpProps = g_new0 (struct SPropValue, 5);
+	recipient->in.ext_cValues = 5;
+
+	val = DT_MAILUSER;
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[0]), PR_DISPLAY_TYPE, (const void *)&val);
+	val = MAPI_MAILUSER;
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[1]), PR_OBJECT_TYPE, (const void *)&val);
+	str = "SMTP";
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[2]), PR_ADDRTYPE, (const void *)(str));
+	str = recipient->email_id;
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[3]), PR_SMTP_ADDRESS, (const void *)(str));
+	set_SPropValue_proptag (&(recipient->in.ext_lpProps[4]), PR_DISPLAY_NAME, (const void *)(str));
+
 	*recipient_list = g_slist_append (*recipient_list, recipient);
 }
 

Modified: branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/servers/mapi/exchange-mapi-connection.c	Thu Jul 31 11:30:57 2008
@@ -835,7 +835,7 @@
 {
 	uint32_t i;
 
-	if (is_external) {
+	if (is_external && recipient->in.ext_lpProps) {
 		struct SBinary *oneoff_eid;
 		struct SPropValue sprop; 
 		const gchar *dn = NULL, *email = NULL; 
@@ -844,7 +844,11 @@
 			SRow_addprop (aRow, recipient->in.ext_lpProps[i]);
 
 		dn = (const gchar *) get_SPropValue (recipient->in.ext_lpProps, PR_DISPLAY_NAME);
+		if (!dn)
+			dn = "";
 		email = (const gchar *) get_SPropValue (recipient->in.ext_lpProps, PR_SMTP_ADDRESS);
+		if (!email)
+			email = "";
 		oneoff_eid = exchange_mapi_util_entryid_generate_oneoff (mem_ctx, dn, email, FALSE);
 		set_SPropValue_proptag (&sprop,  PR_ENTRYID, (const void *)(oneoff_eid));
 		SRow_addprop (aRow, sprop);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]