Merge pull request #1877 from Chris-GW/fix_manual_flag_caldav_syncing

Set the "Manual" flag in the caldav sync, only if it is triggered by the user and he is notified via toasts
This commit is contained in:
Tibor Kaputa 2022-11-11 19:33:26 +01:00 committed by GitHub
commit 93c13cc470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -134,7 +134,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
swipe_refresh_layout.setOnRefreshListener {
refreshCalDAVCalendars(false)
refreshCalDAVCalendars(true)
}
checkIsViewIntent()

View File

@ -603,7 +603,10 @@ fun Context.refreshCalDAVCalendars(ids: String, showToasts: Boolean) {
Bundle().apply {
putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true)
if (showToasts) {
// Assume this is a manual synchronisation when we showToasts to the user (swipe_refresh, MainMenu->refresh_caldav_calendars, ...)
putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true)
}
accounts.forEach {
ContentResolver.requestSync(it, uri.authority, this)
}