bitfireAT/ical4android

Tasks: add tasks app package to PRODID

Closed this issue ยท 2 comments

Currently, we're adding the mutators (the calendar apps that edited an event) to the PRODID like this:

# VEVENT
PRODID:DAVx5/4.2.3.4-ose ical4j/3.2.5 (org.withouthat.acalendarplus)

so that we can see from the ICalendar which calendar app has created the event.

There's no equivalent for tasks and journals. I suggest to add the package name of the used tasks backend to the PRODID like this:

# VTODO
PRODID:DAVx5/4.2.3.4-ose ical4j/3.2.5 (tasks.app.here)

  • Move userAgents from Event up to ICalendar
  • Add task app package name from taskList.provider to task.userAgents in AndroidTask.populateTask()
  • Extract
    if (userAgents.isEmpty())
    prodId
    else
    ProdId(prodId.value + " (" + userAgents.joinToString(",") + ")")
    to a new method ICalendar.prodId() which generates the PRODID with the userAgents (instead of var prodId).
  • Call this prodId() method in Event.write() and Task.write()
  • Similarly add jtx Board package name to
    ical.properties += ICalendar.prodId
  • Adapt PRODID test in TaskTest.testWrite()

@patrickunterwegs Where should we add the test in JtxICalObjectTest?

@rfc2822 @patrickunterwegs I'm not sure if this is the best way to add jtx Board as an agent:

ical.properties += ICalendar.prodId(listOf("at.techbee.jtx"))

Is a constant defined somewhere with the package name? Or should it be hardcoded?

Hi @ArnyminerZ , @rfc2822 ,
there's only the authority in a constant available:
const val AUTHORITY = "at.techbee.jtx.provider"

But I think it's better to keep the package name there and I would also leave it just hardcoded as it's the only place where it's needed in the code. ๐Ÿ‘
Thank you ๐Ÿ™‚