From 86fd2f6fac0a3d5b7dc1bc5b7c1a282ce0cc84de Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 26 Jan 2017 21:53:18 +0100 Subject: [PATCH] make sure we schedule the notifications of imported events --- .../simplemobiletools/calendar/activities/EventActivity.kt | 2 +- .../com/simplemobiletools/calendar/helpers/IcsParser.kt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt index bc950cf92..c5637852e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt @@ -249,7 +249,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener { } if (mEvent.id == 0) { - dbHelper.insert(mEvent) + dbHelper.insert(mEvent) {} } else { dbHelper.update(mEvent) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsParser.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsParser.kt index cb96c1511..9818adf4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsParser.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/IcsParser.kt @@ -1,6 +1,7 @@ package com.simplemobiletools.calendar.helpers import android.content.Context +import com.simplemobiletools.calendar.extensions.scheduleNotification import com.simplemobiletools.calendar.extensions.seconds import com.simplemobiletools.calendar.helpers.IcsParser.ImportResult.* import com.simplemobiletools.calendar.models.Event @@ -51,7 +52,9 @@ class IcsParser { continue val event = Event(0, curStart, curEnd, curTitle, curDescription, reminderMinutes) - dbHelper.insert(event) + dbHelper.insert(event) { + context.scheduleNotification(event) + } eventsImported++ resetValues() }