Skip to content

Commit

Permalink
Renamed timezoneDef to timezoneId
Browse files Browse the repository at this point in the history
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
  • Loading branch information
ArnyminerZ committed Oct 2, 2024
1 parent 967e594 commit 816bcb2
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class DavCollectionRepository @Inject constructor(
displayName = displayName,
description = description,
color = color,
timezoneDef = timeZoneId,
timezoneId = timeZoneId,
supportsVEVENT = supportVEVENT,
supportsVTODO = supportVTODO,
supportsVJOURNAL = supportVJOURNAL
Expand Down Expand Up @@ -291,7 +291,7 @@ class DavCollectionRepository @Inject constructor(
displayName: String?,
description: String?,
color: Int? = null,
timezoneDef: String? = null,
timezoneId: String? = null,
supportsVEVENT: Boolean = true,
supportsVTODO: Boolean = true,
supportsVJOURNAL: Boolean = true
Expand Down Expand Up @@ -347,15 +347,15 @@ class DavCollectionRepository @Inject constructor(
text(DavUtils.ARGBtoCalDAVColor(it))
}
}
timezoneDef?.let { timezoneId ->
timezoneId?.let { id ->
insertTag(CalendarTimezoneId.NAME) {
text(timezoneId)
text(id)
}
getVTimeZone(timezoneId)?.let {
getVTimeZone(id)?.let { vTimezone ->
insertTag(CalendarTimezone.NAME) {
text(
// spec requires "an iCalendar object with exactly one VTIMEZONE component"
Calendar(ComponentList(listOf(it))).toString()
Calendar(ComponentList(listOf(vTimezone))).toString()
)
}
}
Expand Down Expand Up @@ -391,8 +391,7 @@ class DavCollectionRepository @Inject constructor(
return writer.toString()
}

private fun getVTimeZone(tzId: String): VTimeZone? =
DateUtils.ical4jTimeZone(tzId)?.vTimeZone
private fun getVTimeZone(tzId: String): VTimeZone? = DateUtils.ical4jTimeZone(tzId)?.vTimeZone


/*** OBSERVERS ***/
Expand Down

0 comments on commit 816bcb2

Please sign in to comment.