From f0dca9eb0b9967730487d127c1f78ce24207425e Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 17 Jan 2023 12:48:59 +0100 Subject: [PATCH] fix #1677, avoid duplicating CalDAV synced birthdays/anniversaries --- .../calendar/pro/activities/MainActivity.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt index 56e5e13e2..91c2db04f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt @@ -768,8 +768,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { eventsFound++ if (!importIDs.containsKey(contactId)) { - eventsHelper.insertEvent(event, false, false) { - eventsAdded++ + // avoid adding duplicate birthdays/anniversaries + if (existingEvents.none { it.title == event.title && it.startTS == event.startTS }) { + eventsHelper.insertEvent(event, false, false) { + eventsAdded++ + } } } break