Calendar and Hooks

Hi,

The old Calendar emitted several hooks that were very handy to catch in a custom app, but the new Calendar app (>= ownCloud 9) is missing them.

How can I add these hooks to the code of the new app ?

In the old app it was located in apps/calendar/lib/calendar.php and apps/calendar/lib/object.php :

OCP\Util::emitHook('OC_Calendar', 'addCalendar', $insertid);
OCP\Util::emitHook('OC_Calendar', 'editCalendar', $id);
OCP\Util::emitHook('OC_Calendar', 'deleteCalendar', $id);
OCP\Util::emitHook('OC_Calendar', 'addEvent', $id);
OCP\Util::emitHook('OC_Calendar', 'editEvent', $id);
OCP\Util::emitHook('OC_Calendar', 'deleteEvent', $id);
...

I found two files in the new calendar app that could be the triggering sources, but I don’t know how they are connected and which one is the best choice :

businesslayer/objectbusinesslayer.php
controller/objectcontroller.php

and :

businesslayer/calendarbusinesslayer.php
controller/calendarcontroller.php

Could you explain to me the logic between these files (controller / businesslayer), and/or indicate the best “emit place” to create these hooks in the Calendar app ?

Also, I suppose that it will work when the calendar is used with an external software, using CalDAV ?

By the way, do you know why these hooks were removed from the new app ?

It’s a new, rewritten app. So it hasn’t been remove, it wasn’t implemented.

@georgehrke can perhaps help you…

Where did you find this? oO

This was removed years ago


These hooks were removed, because the CalDAV server moved from the calendar app to a dedicated dav app.
This dav app also provides hooks, just with a different name

Where did you find this? oO
This was removed years ago

Well, I probably have messed up the branches when I checked out the repository, I should learn how to properly use git, I guess :flushed:

Thanks a lot for you answer, these are the hooks I was looking for :slight_smile: