feat: ICS Calendars plugin#265
Conversation
|
Hi Thanks for the work. One caveat I see on this server-side subscription feature is that clients that manage client-side subs will end up with twice the same calendar when the plugin is enabled, while clients that do not manage subs will only (correctly) have it once (the "generated" one). Am I correct? So in my opinion, server-side subscription need to be a different mechanism — not tied to actual, client-side subs |
|
You are correct on a technical level but not on a functional level as far as I know. Only making it available as a completely separate mechanism is certainly possible on a technical level, as is extending this to provide both options (behind a flag or w/e). That would require much more invasive changes though. EDIT: this implementation actually has the exact same effect as the existing birthday calendar plugin. Clients that just use the contact birthday information also get duplicates if you use that plugin unless you disable the generated birthday calendar client side. |
I was looking to replace my old calendar setup and decided to switch to Davis but coming from DAViCal there was one thing I was really missing; the external bind functionality it provided. As not all clients can automatically handle advertised webcals, I needed work-arounds or would just not have access to certain calendars on certain devices.
This plugin is heavily inspired by that functionality to facilitate something similar by utilizing the subscriptions functionality already present in Davis.
In short, when the plugin is enabled, it will create calendars for each added subscription, re-using any existing data.
When the subscription is removed, so is the calendar (for the given user only or completely if no other user has it anymore).
A (re-)sync can be forced with the
dav:sync-ics-calendarsconsole command.Note that there's very few clients that actually allow you to add subscriptions to the server in the first place. While adding a custom command or BIND method like DAViCal had done would also have been possible, the subscriptions can already be created using a normal
MKCALENDARoperation. As such, I opted not to add anything custom.If anything, expanding the webinterface to allow managing subscriptions would likely be the much better way to go.
In the mean time, to create a subscription you'd use roughly something like:
Removal is simply a DELETE on the same URL:
This results in something like:

Automatic (re-)sync based on a subscription's
refreshrateand/or a default fallback interval within Davis itself is currently not implemented. Refreshing on a fixed interval can be done by using thedav:sync-ics-calendarsconsole command (e.g. scheduling it with cron).