mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
avoid readding deleted CalDAV synced events
This commit is contained in:
parent
f7d25a19cc
commit
ca89d5fc27
@ -186,7 +186,8 @@ class CalDAVHelper(val context: Context) {
|
||||
CalendarContract.Events.RRULE,
|
||||
CalendarContract.Events.ORIGINAL_ID,
|
||||
CalendarContract.Events.ORIGINAL_INSTANCE_TIME,
|
||||
CalendarContract.Events.EVENT_LOCATION)
|
||||
CalendarContract.Events.EVENT_LOCATION,
|
||||
CalendarContract.Events.DELETED)
|
||||
|
||||
val selection = "${CalendarContract.Events.CALENDAR_ID} = $calendarId"
|
||||
var cursor: Cursor? = null
|
||||
@ -194,6 +195,11 @@ class CalDAVHelper(val context: Context) {
|
||||
cursor = context.contentResolver.query(uri, projection, selection, null, null)
|
||||
if (cursor?.moveToFirst() == true) {
|
||||
do {
|
||||
val deleted = cursor.getIntValue(CalendarContract.Events.DELETED)
|
||||
if (deleted == 1) {
|
||||
continue
|
||||
}
|
||||
|
||||
val id = cursor.getLongValue(CalendarContract.Events._ID)
|
||||
val title = cursor.getStringValue(CalendarContract.Events.TITLE) ?: ""
|
||||
val description = cursor.getStringValue(CalendarContract.Events.DESCRIPTION) ?: ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user