mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-14 03:32:22 -05:00
Caldav: Convert DISPLAY to AUDIO only if user defined an alarm sound in settings (davmail.caldavAlarmSound)
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@889 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
6e11cab446
commit
9424b1e639
@ -1470,21 +1470,6 @@ public class ExchangeSession {
|
||||
return permanentUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return encoded message name.
|
||||
*
|
||||
* @return encoded message name
|
||||
* @throws IOException on error
|
||||
*/
|
||||
public String getEncodedMessageName() throws IOException {
|
||||
int index = messageUrl.lastIndexOf('/');
|
||||
if (index < 0) {
|
||||
throw new DavMailException("EXCEPTION_INVALID_MESSAGE_URL", messageUrl);
|
||||
}
|
||||
|
||||
return URIUtil.encodePath(messageUrl.substring(index + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return message flags in IMAP format.
|
||||
*
|
||||
@ -1916,10 +1901,6 @@ public class ExchangeSession {
|
||||
} else if ("ATTACH;VALUES=URI".equals(key)) {
|
||||
// This is a marker that this event has an alarm with sound
|
||||
sound = true;
|
||||
// Set the default sound to whatever this event contains
|
||||
// (under assumption that the user has the same sound set
|
||||
// for all events)
|
||||
defaultSound = value;
|
||||
} else if (key.startsWith("ORGANIZER")) {
|
||||
if (value.startsWith("MAILTO:")) {
|
||||
organizer = value.substring(7);
|
||||
@ -2044,18 +2025,15 @@ public class ExchangeSession {
|
||||
|
||||
}
|
||||
} else if (line.startsWith("ACTION:")) {
|
||||
if (fromServer && "DISPLAY".equals(action)) {
|
||||
// Use the default iCal alarm action instead
|
||||
// of the alarm Action exchange (and blackberry) understand.
|
||||
// This is a bit of a hack because we don't know what type
|
||||
// of alarm an iCal user really wants - but we know what the
|
||||
// default is, and can setup the default action type
|
||||
|
||||
if (fromServer && "DISPLAY".equals(action)
|
||||
// convert DISPLAY to AUDIO only if user defined an alarm sound
|
||||
&& Settings.getProperty("davmail.caldavAlarmSound")!= null) {
|
||||
// Convert alarm to audio for iCal
|
||||
result.writeLine("ACTION:AUDIO");
|
||||
|
||||
if (!sound) {
|
||||
// Add default sound into the audio alarm
|
||||
result.writeLine("ATTACH;VALUE=URI:" + defaultSound);
|
||||
// Add defined sound into the audio alarm
|
||||
result.writeLine("ATTACH;VALUE=URI:" + Settings.getProperty("davmail.caldavAlarmSound"));
|
||||
}
|
||||
|
||||
continue;
|
||||
@ -2608,7 +2586,6 @@ public class ExchangeSession {
|
||||
}
|
||||
|
||||
private static int dumpIndex;
|
||||
private String defaultSound = "Basso";
|
||||
|
||||
/**
|
||||
* Replace iCal4 (Snow Leopard) principal paths with mailto expression
|
||||
|
Loading…
Reference in New Issue
Block a user