mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 04:10:45 +01:00
Resolves (or at least improves):
- #1538 - https://github.com/bitfireAT/davx5-ose/discussions/66 - https://github.com/Kozea/Radicale/issues/1264 - May also resolve some of the issues described in #1983. The "EXDATE" property is only meant to be set on events with the "RRULE" property. See discussion in #1538, especially the response from DAVx5 support listed in the first comment. I tried also setting STATUS_CANCELED on these recurrence exception events, but DAVx5 would sometimes no longer recognize them as belonging to the parent event and would give the child events different UIDs, which is undesirable. It seems like it works great to just leave out the EXDATE. I have not tested this patch with other CalDAV setups, but it solves the problem for me on DAVx5+Radicale.
This commit is contained in:
parent
002b058a5e
commit
b7c90f9cfb
@ -1310,7 +1310,7 @@ class EventActivity : SimpleActivity() {
|
||||
EditRepeatingEventDialog(this) {
|
||||
hideKeyboard()
|
||||
when (it) {
|
||||
0 -> {
|
||||
EDIT_SELECTED_OCCURRENCE -> {
|
||||
ensureBackgroundThread {
|
||||
eventsHelper.addEventRepetitionException(mEvent.id!!, mEventOccurrenceTS, true)
|
||||
mEvent.apply {
|
||||
@ -1326,7 +1326,7 @@ class EventActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
1 -> {
|
||||
EDIT_FUTURE_OCCURRENCES -> {
|
||||
ensureBackgroundThread {
|
||||
eventsHelper.addEventRepeatLimit(mEvent.id!!, mEventOccurrenceTS)
|
||||
mEvent.apply {
|
||||
@ -1338,8 +1338,7 @@ class EventActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2 -> {
|
||||
EDIT_ALL_OCCURRENCES -> {
|
||||
ensureBackgroundThread {
|
||||
eventsHelper.addEventRepeatLimit(mEvent.id!!, mEventOccurrenceTS)
|
||||
eventsHelper.updateEvent(mEvent, updateAtCalDAV = true, showToasts = true) {
|
||||
|
@ -464,7 +464,7 @@ class TaskActivity : SimpleActivity() {
|
||||
EditRepeatingEventDialog(this, isTask = true) {
|
||||
hideKeyboard()
|
||||
when (it) {
|
||||
0 -> {
|
||||
EDIT_SELECTED_OCCURRENCE -> {
|
||||
ensureBackgroundThread {
|
||||
eventsHelper.addEventRepetitionException(mTask.id!!, mTaskOccurrenceTS, addToCalDAV = false)
|
||||
mTask.apply {
|
||||
@ -480,7 +480,7 @@ class TaskActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
1 -> {
|
||||
EDIT_FUTURE_OCCURRENCES -> {
|
||||
ensureBackgroundThread {
|
||||
eventsHelper.addEventRepeatLimit(mTask.id!!, mTaskOccurrenceTS)
|
||||
mTask.apply {
|
||||
@ -492,7 +492,7 @@ class TaskActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
EDIT_ALL_OCCURRENCES -> {
|
||||
ensureBackgroundThread {
|
||||
eventsHelper.addEventRepeatLimit(mTask.id!!, mTaskOccurrenceTS)
|
||||
eventsHelper.updateEvent(mTask, updateAtCalDAV = false, showToasts = true) {
|
||||
|
@ -4,6 +4,9 @@ import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import com.simplemobiletools.calendar.pro.R
|
||||
import com.simplemobiletools.calendar.pro.activities.SimpleActivity
|
||||
import com.simplemobiletools.calendar.pro.helpers.EDIT_ALL_OCCURRENCES
|
||||
import com.simplemobiletools.calendar.pro.helpers.EDIT_FUTURE_OCCURRENCES
|
||||
import com.simplemobiletools.calendar.pro.helpers.EDIT_SELECTED_OCCURRENCE
|
||||
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
@ -14,9 +17,9 @@ class EditRepeatingEventDialog(val activity: SimpleActivity, val isTask: Boolean
|
||||
|
||||
init {
|
||||
val view = (activity.layoutInflater.inflate(R.layout.dialog_edit_repeating_event, null) as ViewGroup).apply {
|
||||
edit_repeating_event_one_only.setOnClickListener { sendResult(0) }
|
||||
edit_repeating_event_this_and_future_occurences.setOnClickListener { sendResult(1) }
|
||||
edit_repeating_event_all_occurrences.setOnClickListener { sendResult(2) }
|
||||
edit_repeating_event_one_only.setOnClickListener { sendResult(EDIT_SELECTED_OCCURRENCE) }
|
||||
edit_repeating_event_this_and_future_occurences.setOnClickListener { sendResult(EDIT_FUTURE_OCCURRENCES) }
|
||||
edit_repeating_event_all_occurrences.setOnClickListener { sendResult(EDIT_ALL_OCCURRENCES) }
|
||||
|
||||
if (isTask) {
|
||||
edit_repeating_event_title.setText(R.string.task_is_repeatable)
|
||||
|
@ -502,7 +502,6 @@ class CalDAVHelper(val context: Context) {
|
||||
put(Events.ORIGINAL_ID, event.getCalDAVEventId())
|
||||
put(Events.EVENT_TIMEZONE, TimeZone.getDefault().id.toString())
|
||||
put(Events.ORIGINAL_INSTANCE_TIME, occurrenceTS * 1000L)
|
||||
put(Events.EXDATE, Formatter.getDayCodeFromTS(occurrenceTS))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,6 +232,10 @@ const val DELETE_SELECTED_OCCURRENCE = 0
|
||||
const val DELETE_FUTURE_OCCURRENCES = 1
|
||||
const val DELETE_ALL_OCCURRENCES = 2
|
||||
|
||||
const val EDIT_SELECTED_OCCURRENCE = 0
|
||||
const val EDIT_FUTURE_OCCURRENCES = 1
|
||||
const val EDIT_ALL_OCCURRENCES = 2
|
||||
|
||||
const val REMINDER_NOTIFICATION = 0
|
||||
const val REMINDER_EMAIL = 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user