Merge pull request #2053 from evan-goode/master

Don't set EXDATE on recurrence exceptions
This commit is contained in:
Tibor Kaputa 2023-05-18 14:41:22 +02:00 committed by GitHub
commit 9771c504ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 12 deletions

View file

@ -1356,7 +1356,7 @@ class EventActivity : SimpleActivity() {
EditRepeatingEventDialog(this) {
hideKeyboard()
when (it) {
0 -> {
EDIT_SELECTED_OCCURRENCE -> {
ensureBackgroundThread {
eventsHelper.addEventRepetitionException(mEvent.id!!, mEventOccurrenceTS, true)
mEvent.apply {
@ -1372,8 +1372,7 @@ class EventActivity : SimpleActivity() {
}
}
}
1 -> {
EDIT_FUTURE_OCCURRENCES -> {
ensureBackgroundThread {
eventsHelper.addEventRepeatLimit(mEvent.id!!, mEventOccurrenceTS)
mEvent.apply {
@ -1385,8 +1384,7 @@ class EventActivity : SimpleActivity() {
}
}
}
2 -> {
EDIT_ALL_OCCURRENCES -> {
ensureBackgroundThread {
eventsHelper.addEventRepeatLimit(mEvent.id!!, mEventOccurrenceTS)
eventsHelper.updateEvent(mEvent, updateAtCalDAV = true, showToasts = true) {

View file

@ -472,7 +472,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 {
@ -488,7 +488,7 @@ class TaskActivity : SimpleActivity() {
}
}
}
1 -> {
EDIT_FUTURE_OCCURRENCES -> {
ensureBackgroundThread {
eventsHelper.addEventRepeatLimit(mTask.id!!, mTaskOccurrenceTS)
mTask.apply {
@ -500,7 +500,7 @@ class TaskActivity : SimpleActivity() {
}
}
}
2 -> {
EDIT_ALL_OCCURRENCES -> {
ensureBackgroundThread {
eventsHelper.addEventRepeatLimit(mTask.id!!, mTaskOccurrenceTS)
eventsHelper.updateEvent(mTask, updateAtCalDAV = false, showToasts = true) {

View file

@ -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)

View file

@ -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))
}
}

View file

@ -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