[evolution-ews] Attendee (organizer) string do not have to start with *MAILTO* pattern



commit 2fa831d885562c6b2d26fd92dab1b465cf63a203
Author: Pavel Ocheretny <pocheretny src gnome org>
Date:   Tue Jun 14 23:19:44 2011 +0300

    Attendee (organizer) string do not have to start with *MAILTO* pattern

 src/calendar/e-cal-backend-ews.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index ca6c8be..64da2c4 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -1514,15 +1514,20 @@ static const char*
 e_ews_get_current_user_meeting_reponse (icalcomponent *icalcomp, const char *current_user_mail)
 {
 	icalproperty *attendee;
-	const char *attendee_str = NULL;
+	const char *attendee_str = NULL, *attendee_mail = NULL;
 	for (attendee = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY);
 		attendee != NULL;
 		attendee = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) {
 		attendee_str = icalproperty_get_attendee (attendee);
-		if ((attendee_str != NULL) && !strncasecmp (attendee_str, "MAILTO:", 7))
-			if (g_strcmp0 (attendee_str + 7 , current_user_mail) == 0) {
+
+		if (attendee_str != NULL){
+			if (!strncasecmp (attendee_str, "MAILTO:", 7))
+				attendee_mail = attendee_str + 7;
+			else
+				attendee_mail = attendee_str;
+			if (g_strcmp0 (attendee_mail, current_user_mail) == 0)
 				return icalproperty_get_parameter_as_string (attendee, "PARTSTAT");
-			}
+		}
 	}
 	return NULL;
 }



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