mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12: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:
parent
3144b001d3
commit
5f76f05c64
@ -657,7 +657,7 @@ public class ExchangeSession {
|
||||
public MessageList searchMessages(String folderName, String attributes, String conditions) throws IOException {
|
||||
String folderUrl = getFolderPath(folderName);
|
||||
MessageList messages = new MessageList();
|
||||
String searchRequest = "Select "+ attributes +
|
||||
String searchRequest = "Select " + attributes +
|
||||
" FROM Scope('SHALLOW TRAVERSAL OF \"" + folderUrl + "\"')\n" +
|
||||
" WHERE \"DAV:ishidden\" = False AND \"DAV:isfolder\" = False\n";
|
||||
if (conditions != null) {
|
||||
@ -1313,6 +1313,7 @@ public class ExchangeSession {
|
||||
// Convert event class from and to iCal
|
||||
// See https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-privateevents.txt
|
||||
boolean isAppleiCal = false;
|
||||
boolean hasOrganizer = false;
|
||||
String eventClass = null;
|
||||
|
||||
List<AllDayState> allDayStates = new ArrayList<AllDayState>();
|
||||
@ -1340,6 +1341,8 @@ public class ExchangeSession {
|
||||
eventClass = value;
|
||||
} else if (!isAppleiCal && "CLASS".equals(key)) {
|
||||
eventClass = value;
|
||||
} else if (key.startsWith("ORGANIZER")) {
|
||||
hasOrganizer = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1402,6 +1405,10 @@ public class ExchangeSession {
|
||||
result.writeLine("X-CALENDARSERVER-ACCESS:" + eventClass);
|
||||
}
|
||||
}
|
||||
} else if ("END:VEVENT".equals(line)) {
|
||||
if (!hasOrganizer) {
|
||||
result.writeLine("ORGANIZER:MAILTO:" + email);
|
||||
}
|
||||
}
|
||||
result.writeLine(line);
|
||||
}
|
||||
@ -1485,6 +1492,7 @@ public class ExchangeSession {
|
||||
/**
|
||||
* Parse ics event for attendees and organizer.
|
||||
* For notifications, only include attendees with RSVP=TRUE or PARTSTAT=NEEDS-ACTION
|
||||
*
|
||||
* @param icsBody ics event
|
||||
* @param isNotification get only notified attendees
|
||||
* @return participants
|
||||
@ -1517,8 +1525,8 @@ public class ExchangeSession {
|
||||
// also exclude no action attendees
|
||||
} else if (!email.equalsIgnoreCase(value) && value.indexOf('@') >= 0
|
||||
&& (!isNotification
|
||||
|| line.indexOf("RSVP=TRUE") >= 0)
|
||||
|| line.indexOf("PARTSTAT=NEEDS-ACTION") >=0) {
|
||||
|| line.indexOf("RSVP=TRUE") >= 0
|
||||
|| line.indexOf("PARTSTAT=NEEDS-ACTION") >= 0)) {
|
||||
attendees.add(value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user