aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-04-22 17:42:58 +0000
committerMario <mario@mariovavti.com>2021-04-22 17:42:58 +0000
commitc19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a (patch)
tree4a051abb43624dee8d505dd14f9e1da3c9518bfd
parenteb793b160103bddab071ca7e91daf500ec262315 (diff)
downloadvolse-hubzilla-c19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a.tar.gz
volse-hubzilla-c19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a.tar.bz2
volse-hubzilla-c19eb94c52f40777d0ffaf6b91a3fc2eaaf6910a.zip
make sure we transform events to UTC on import before storing. Transform from event timezone if available otherwise channel default
-rw-r--r--Zotlabs/Module/Cdav.php4
-rw-r--r--include/event.php10
2 files changed, 7 insertions, 7 deletions
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index a7d2b1169..e26cdd072 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -269,7 +269,7 @@ class Cdav extends Controller {
// Plugins
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($auth));
- //$server->addPlugin(new \Sabre\DAV\Browser\Plugin());
+ // $server->addPlugin(new \Sabre\DAV\Browser\Plugin());
$server->addPlugin(new \Sabre\DAV\Sync\Plugin());
$server->addPlugin(new \Sabre\DAV\Sharing\Plugin());
$server->addPlugin(new \Sabre\DAVACL\Plugin());
@@ -277,7 +277,7 @@ class Cdav extends Controller {
// CalDAV plugins
$server->addPlugin(new \Sabre\CalDAV\Plugin());
$server->addPlugin(new \Sabre\CalDAV\SharingPlugin());
- //$server->addPlugin(new \Sabre\CalDAV\Schedule\Plugin());
+ // $server->addPlugin(new \Sabre\CalDAV\Schedule\Plugin());
$server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
// CardDAV plugins
diff --git a/include/event.php b/include/event.php
index 765086167..440f559da 100644
--- a/include/event.php
+++ b/include/event.php
@@ -862,15 +862,15 @@ function event_import_ical($ical, $uid) {
// we do not have it here since parse_ical_file() is passing the vevent only.
$timezone_obj = \Sabre\VObject\TimeZoneUtil::getTimeZone($ical->DTSTART['TZID']);
$timezone = $timezone_obj->getName();
- $ev['timezone'] = $timezone;
+ $ev['timezone'] = (($timezone) ? $timezone : date_default_timezone_get());
}
- $ev['dtstart'] = datetime_convert((($ev['adjust']) ? 'UTC' : date_default_timezone_get()),$ev['timezone'],
+ $ev['dtstart'] = datetime_convert((($ev['adjust']) ? 'UTC' : $ev['timezone']), 'UTC',
$dtstart->format(\DateTime::W3C));
if(isset($ical->DTEND)) {
$dtend = $ical->DTEND->getDateTime();
- $ev['dtend'] = datetime_convert((($ev['adjust']) ? 'UTC' : date_default_timezone_get()),$ev['timezone'],
+ $ev['dtend'] = datetime_convert((($ev['adjust']) ? 'UTC' : $ev['timezone']), 'UTC',
$dtend->format(\DateTime::W3C));
}
else {
@@ -1311,9 +1311,9 @@ function event_store_item($arr, $event) {
}
// propagate the event resource_id so that posts containing it are easily searchable in downstream copies
- // of the item which have not stored the actual event. Required for Diaspora event federation as Diaspora
+ // of the item which have not stored the actual event. Required for Diaspora event federation as Diaspora
// event_participation messages refer to the event resource_id as a parent, while out own event attendance
- // activities refer to the item message_id as the parent.
+ // activities refer to the item message_id as the parent.
set_iconfig($item_arr, 'system','event_id',$event['event_hash'],true);