mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 03:02:22 -05:00
Caldav: fix regression on iCal FreeBusy handling
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1724 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
2739a51ea3
commit
913a4d76e8
@ -2773,7 +2773,7 @@ public abstract class ExchangeSession {
|
||||
* @return fixed value
|
||||
*/
|
||||
protected String replaceIcal4Principal(String value) {
|
||||
if (value.contains("/principals/__uuids__/")) {
|
||||
if (value != null && value.contains("/principals/__uuids__/")) {
|
||||
return value.replaceAll("/principals/__uuids__/([^/]*)__AT__([^/]*)/", "mailto:$1@$2");
|
||||
} else {
|
||||
return value;
|
||||
@ -3216,12 +3216,14 @@ public abstract class ExchangeSession {
|
||||
* @throws IOException on error
|
||||
*/
|
||||
public FreeBusy getFreebusy(String attendee, String startDateValue, String endDateValue) throws IOException {
|
||||
// first check that email address is valid to avoid InvalidSmtpAddress error
|
||||
// replace ical encoded attendee name
|
||||
attendee = replaceIcal4Principal(attendee);
|
||||
|
||||
// then check that email address is valid to avoid InvalidSmtpAddress error
|
||||
if (attendee == null || attendee.indexOf('@') < 0 || attendee.charAt(attendee.length() - 1) == '@') {
|
||||
return null;
|
||||
}
|
||||
|
||||
attendee = replaceIcal4Principal(attendee);
|
||||
if (attendee.startsWith("mailto:") || attendee.startsWith("MAILTO:")) {
|
||||
attendee = attendee.substring("mailto:".length());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user