Commit 31339f30 authored by Ricki Hirner's avatar Ricki Hirner 🐑

Don't create default reminder for full-day events

parent 6f1d513e
Pipeline #107469576 passed with stages
in 8 minutes and 21 seconds
......@@ -206,7 +206,7 @@ class AccountSettings(
* 2. the settings provider (unless the value is -1 there).
*
* @return A default reminder shall be created this number of minutes before the start of every
* event without reminder. *null*: No default reminders shall be created.
* non-full-day event without reminder. *null*: No default reminders shall be created.
*/
fun getDefaultAlarm() =
accountManager.getUserData(account, KEY_DEFAULT_ALARM)?.toInt() ?:
......@@ -219,7 +219,7 @@ class AccountSettings(
* value applies.
*
* @param minBefore The number of minutes a default reminder shall be created before the
* start of every event without reminder. *null*: No default reminders shall be created.
* start of every non-full-day event without reminder. *null*: No default reminders shall be created.
*/
fun setDefaultAlarm(minBefore: Int?) =
accountManager.setUserData(account, KEY_DEFAULT_ALARM,
......
......@@ -169,9 +169,9 @@ class CalendarSyncManager(
if (events.size == 1) {
val event = events.first()
// set default reminder, if requested
// set default reminder for non-full-day events, if requested
val defaultAlarmMinBefore = accountSettings.getDefaultAlarm()
if (defaultAlarmMinBefore != null && event.alarms.isEmpty()) {
if (defaultAlarmMinBefore != null && !event.isAllDay() && event.alarms.isEmpty()) {
val alarm = VAlarm(Dur(0, 0, -defaultAlarmMinBefore, 0))
Logger.log.log(Level.FINE, "${event.uid}: Adding default alarm", alarm)
event.alarms += alarm
......
Subproject commit 605b90452d76da0455e41d44895c358c2cf486d4
Subproject commit be6d515db8721008bdc93a9a6668f51b4a79502e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment