Caldav: and also set missing METHOD:REQUEST

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@472 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-21 10:39:13 +00:00
parent 5a517a8a94
commit ab8dd30c4d
1 changed files with 10 additions and 5 deletions

View File

@ -1508,12 +1508,17 @@ public class ExchangeSession {
body.append("To: ").append(participants.attendees).append("\r\n");
body.append("From: ").append(participants.organizer).append("\r\n");
// if not organizer, set REPLYTIME to force Outlook in attendee mode
if (!email.equalsIgnoreCase(participants.organizer) && icsBody.indexOf("X-MICROSOFT-CDO-REPLYTIME") <0) {
SimpleDateFormat icalFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
icalFormatter.setTimeZone(GMT_TIMEZONE);
if (!email.equalsIgnoreCase(participants.organizer)) {
if (icsBody.indexOf("METHOD:") < 0) {
icsBody = icsBody.replaceAll("BEGIN:VCALENDAR", "BEGIN:VCALENDAR\r\nMETHOD:REQUEST");
}
if (icsBody.indexOf("X-MICROSOFT-CDO-REPLYTIME") < 0) {
SimpleDateFormat icalFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
icalFormatter.setTimeZone(GMT_TIMEZONE);
icsBody = icsBody.replaceAll("END:VEVENT", "X-MICROSOFT-CDO-REPLYTIME:"+
icalFormatter.format(new Date())+"\r\nEND:VEVENT");
icsBody = icsBody.replaceAll("END:VEVENT", "X-MICROSOFT-CDO-REPLYTIME:" +
icalFormatter.format(new Date()) + "\r\nEND:VEVENT");
}
}
}
body.append("MIME-Version: 1.0\r\n" +