1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 03:32:22 -05:00

Fix empty organizer field in ICS (active sync support) and another getParticipants bug

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@613 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-07-08 22:51:34 +00:00
parent 3144b001d3
commit 5f76f05c64

View File

@ -1313,6 +1313,7 @@ public class ExchangeSession {
// Convert event class from and to iCal // Convert event class from and to iCal
// See https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-privateevents.txt // See https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-privateevents.txt
boolean isAppleiCal = false; boolean isAppleiCal = false;
boolean hasOrganizer = false;
String eventClass = null; String eventClass = null;
List<AllDayState> allDayStates = new ArrayList<AllDayState>(); List<AllDayState> allDayStates = new ArrayList<AllDayState>();
@ -1340,6 +1341,8 @@ public class ExchangeSession {
eventClass = value; eventClass = value;
} else if (!isAppleiCal && "CLASS".equals(key)) { } else if (!isAppleiCal && "CLASS".equals(key)) {
eventClass = value; eventClass = value;
} else if (key.startsWith("ORGANIZER")) {
hasOrganizer = true;
} }
} }
} }
@ -1402,6 +1405,10 @@ public class ExchangeSession {
result.writeLine("X-CALENDARSERVER-ACCESS:" + eventClass); result.writeLine("X-CALENDARSERVER-ACCESS:" + eventClass);
} }
} }
} else if ("END:VEVENT".equals(line)) {
if (!hasOrganizer) {
result.writeLine("ORGANIZER:MAILTO:" + email);
}
} }
result.writeLine(line); result.writeLine(line);
} }
@ -1485,6 +1492,7 @@ public class ExchangeSession {
/** /**
* Parse ics event for attendees and organizer. * Parse ics event for attendees and organizer.
* For notifications, only include attendees with RSVP=TRUE or PARTSTAT=NEEDS-ACTION * For notifications, only include attendees with RSVP=TRUE or PARTSTAT=NEEDS-ACTION
*
* @param icsBody ics event * @param icsBody ics event
* @param isNotification get only notified attendees * @param isNotification get only notified attendees
* @return participants * @return participants
@ -1517,8 +1525,8 @@ public class ExchangeSession {
// also exclude no action attendees // also exclude no action attendees
} else if (!email.equalsIgnoreCase(value) && value.indexOf('@') >= 0 } else if (!email.equalsIgnoreCase(value) && value.indexOf('@') >= 0
&& (!isNotification && (!isNotification
|| line.indexOf("RSVP=TRUE") >= 0) || line.indexOf("RSVP=TRUE") >= 0
|| line.indexOf("PARTSTAT=NEEDS-ACTION") >=0) { || line.indexOf("PARTSTAT=NEEDS-ACTION") >= 0)) {
attendees.add(value); attendees.add(value);
} }
} }