Merge pull request #58 from CatoTH/master

DAV: Fix a error in the event-hooks
pull/59/head
zzottel 2012-06-06 03:37:06 -07:00
commit bef36e1b17
1 changed files with 48 additions and 42 deletions

View File

@ -22,18 +22,7 @@ function dav_module()
{
}
/**
* @param App $a
*/
function dav_init(&$a)
{
/*
* Recommended settings:
* ALTER TABLE `photo` ADD INDEX ( `contact-id` )
*/
function dav_include_files() {
require_once (__DIR__ . "/common/dbclasses/dbclass_animexx.class.php");
require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.calendars.class.php");
require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.jqcalendar.class.php");
@ -75,6 +64,21 @@ function dav_init(&$a)
require_once (__DIR__ . "/calendar.friendica.fnk.php");
require_once (__DIR__ . "/layout.fnk.php");
}
/**
* @param App $a
*/
function dav_init(&$a)
{
/*
* Recommended settings:
* ALTER TABLE `photo` ADD INDEX ( `contact-id` )
*/
dav_include_files();
if (false) {
dbg(true);
@ -197,6 +201,7 @@ function dav_content()
*/
function dav_event_created_hook(&$a, &$b)
{
dav_include_files();
// @TODO Updating the cache instead of completely invalidating and rebuilding it
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_CONTACTS);
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_MINE);
@ -208,6 +213,7 @@ function dav_event_created_hook(&$a, &$b)
*/
function dav_event_updated_hook(&$a, &$b)
{
dav_include_files();
// @TODO Updating the cache instead of completely invalidating and rebuilding it
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_CONTACTS);
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_MINE);