From e45958b967d3b455167191fa91b0c2b6983b6ad5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 23 Sep 2015 18:27:04 -0700 Subject: [PATCH 1/4] add plugin hooks to channel sync/import/export --- include/identity.php | 4 ++++ include/zot.php | 2 ++ mod/import.php | 2 ++ 3 files changed, 8 insertions(+) diff --git a/include/identity.php b/include/identity.php index b5235e7ff..47738a8fa 100644 --- a/include/identity.php +++ b/include/identity.php @@ -616,6 +616,10 @@ function identity_basic_export($channel_id, $items = false) { } } + $addon = array('channel_id' => $channel_id,'data' => $ret); + call_hooks('identity_basic_export',$addon); + $ret = $addon['data']; + if(! $items) return $ret; diff --git a/include/zot.php b/include/zot.php index 288493b07..9bddb520d 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3319,6 +3319,8 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('item_id',$arr) && $arr['item_id']) sync_items($channel,$arr['item_id']); + $addon = array('channel' => $channel,'data' => $arr); + call_hooks('process_channel_sync_delivery',$addon); // we should probably do this for all items, but usually we only send one. diff --git a/mod/import.php b/mod/import.php index 563967aa2..b6e36d734 100644 --- a/mod/import.php +++ b/mod/import.php @@ -450,6 +450,8 @@ function import_post(&$a) { if(is_array($data['menu'])) import_menus($channel,$data['menu']); + $addon = array('channel' => $channel,'data' => $data); + call_hooks('import_channel',$addon); $saved_notification_flags = notifications_off($channel['channel_id']); From b553ffd55d04d11c0802b1688d74e96f3ed01ddf Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 23 Sep 2015 20:59:19 -0700 Subject: [PATCH 2/4] timezone tweaks --- include/event.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/event.php b/include/event.php index 44c172e98..f0a806dfa 100644 --- a/include/event.php +++ b/include/event.php @@ -526,13 +526,17 @@ function event_import_ical($ical, $uid) { // logger('dtstart: ' . var_export($dtstart,true)); - if(($dtstart->timezone_type == 2) || (($dtstart->timezone_type == 3) && ($dtstart->timezone === 'UTC'))) { - $ev['adjust'] = 1; + + switch($dtstart->timezone_type) { + case VObject\Property\DateTime::UTC : + $ev['adjust'] = 0; + break; + case VObject\Property\DateTime::LOCALTZ : + default: + $ev['adjust'] = 1; + break; } - else { - $ev['adjust'] = 0; - } - + $ev['start'] = datetime_convert((($ev['adjust']) ? 'UTC' : date_default_timezone_get()),'UTC', $dtstart->format(\DateTime::W3C)); From 8a94a4938fb85baca4a8104cbf6802a59459d17e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 23 Sep 2015 22:31:49 -0700 Subject: [PATCH 3/4] dummy update --- boot.php | 2 +- install/update.php | 6 +++++- version.inc | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index bde797347..4d2296204 100755 --- a/boot.php +++ b/boot.php @@ -49,7 +49,7 @@ define ( 'PLATFORM_NAME', 'redmatrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1154 ); +define ( 'DB_UPDATE_VERSION', 1155 ); /** * @brief Constant with a HTML line break. diff --git a/install/update.php b/install/update.php index c90d4abbb..3ce1736f5 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Wed, 23 Sep 2015 22:32:46 -0700 Subject: [PATCH 4/4] add vdata field for caldav --- boot.php | 2 +- install/schema_mysql.sql | 1 + install/schema_postgres.sql | 1 + install/update.php | 11 ++++++++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index 5a564bb9d..8e0e3b004 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'H'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1154 ); +define ( 'DB_UPDATE_VERSION', 1155 ); /** * @brief Constant with a HTML line break. diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index a21e5f48a..c78259e41 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -396,6 +396,7 @@ CREATE TABLE IF NOT EXISTS `event` ( `event_repeat` text NOT NULL, `event_sequence` smallint(6) NOT NULL DEFAULT '0', `event_priority` smallint(6) NOT NULL DEFAULT '0', + `event_vdata` text NOT NULL, PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `type` (`type`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 26d7d79a3..6145e9ccb 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -392,6 +392,7 @@ CREATE TABLE "event" ( "event_repeat" text NOT NULL, "event_sequence" smallint NOT NULL DEFAULT '0', "event_priority" smallint NOT NULL DEFAULT '0', + "event_vdata" text NOT NULL, PRIMARY KEY ("id") ); create index "event_uid_idx" on event ("uid"); diff --git a/install/update.php b/install/update.php index bef754570..500a89fc0 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@