Merge pull request #58 from CatoTH/master

DAV: Fix a error in the event-hooks
This commit is contained in:
zzottel 2012-06-06 03:37:06 -07:00
commit bef36e1b17

View File

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