From 9813ddd6dec012d6bbeb7830c91642f4e07d966a Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 4 Dec 2018 16:27:55 +0100 Subject: [PATCH] insert event repetition exceptions through eventsHelper --- .../com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt | 2 +- .../com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt index 3f761bf0e..04dbbb7c7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/CalDAVHelper.kt @@ -232,7 +232,7 @@ class CalDAVHelper(val context: Context) { if (parentEvent != null && !parentEvent.repetitionExceptions.contains(originalDayCode)) { event.parentId = parentEvent.id!! parentEvent.addRepetitionException(originalDayCode) - activity!!.eventsDB.insertOrUpdate(parentEvent) + eventsHelper.insertEvent(null, parentEvent, false) event.parentId = parentEvent.id!! eventsHelper.insertEvent(null, event, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt index 21001d23c..0239c1d71 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/IcsImporter.kt @@ -174,7 +174,8 @@ class IcsImporter(val activity: SimpleActivity) { val parentEvent = activity.eventsDB.getEventWithImportId(event.importId) if (parentEvent != null && !parentEvent.repetitionExceptions.contains(curRecurrenceDayCode)) { parentEvent.addRepetitionException(curRecurrenceDayCode) - activity.eventsDB.insertOrUpdate(parentEvent) + eventsHelper.insertEvent(null, parentEvent, true) + event.parentId = parentEvent.id!! eventsToInsert.add(event) }