[evolution-ews] Identify organizer mail from property when not mail to started with *MAILTO* In some case like when



commit 15cfc4f5c2348e50606625a8559a4beacf00a92e
Author: Pavel Ocheretny <pocheretny src gnome org>
Date:   Tue Jun 14 22:22:42 2011 +0300

    Identify organizer mail from property when not mail to started with *MAILTO*
    In some case like when new time was proposed for a meeting the organizer is not started with with *MAILTO*

 src/calendar/e-cal-backend-ews-utils.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews-utils.c b/src/calendar/e-cal-backend-ews-utils.c
index 6c868b6..21f507f 100644
--- a/src/calendar/e-cal-backend-ews-utils.c
+++ b/src/calendar/e-cal-backend-ews-utils.c
@@ -47,11 +47,18 @@ void e_ews_collect_attendees(icalcomponent *comp, GSList **required, GSList **op
 	icalproperty *prop, *org_prop = NULL;
 	icalparameter *param;
 	const gchar *org = NULL, *str = NULL;
+	const char *org_email_address = NULL;
 
 	/* we need to know who the orgenizer is so we wont duplicate him/her */
 	org_prop = icalcomponent_get_first_property (comp, ICAL_ORGANIZER_PROPERTY);
 	org = icalproperty_get_organizer(org_prop);
-	if (!org) org = "";
+	if (!org)
+		org = "";
+	else
+		if (g_ascii_strncasecmp (org, "MAILTO:", 7))
+				org_email_address = (org) + 7;
+			else
+				org_email_address = org;
 
 	/* iterate over every attendee property */
 	for (prop = icalcomponent_get_first_property(comp, ICAL_ATTENDEE_PROPERTY);
@@ -60,8 +67,9 @@ void e_ews_collect_attendees(icalcomponent *comp, GSList **required, GSList **op
 
 		str = icalproperty_get_attendee(prop);
 
-		/* if this attenddee is the orgenizer - dont add him/her */
-		if (g_ascii_strcasecmp(org, str) == 0) continue;
+		/* if this attenddee is the orgenizer - dont add him/her
+		 in some cases there is no maito for email if meeting orginazer*/
+		if (g_ascii_strcasecmp(org_email_address, str) == 0) continue;
 
 		/* figure the email address of the attendee, discard "mailto:"; if it's there */
 		if (!g_ascii_strncasecmp (str, "mailto:";, 7)) str = (str) + 7;



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