From 56e54ac820b32f4b5f7d3f554191079003ac78a5 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 28 Sep 2023 16:55:49 +0000 Subject: if the item is sourced and provides an event add it to the calendar --- Zotlabs/Lib/Libzot.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 032fae3fc..383785992 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1871,8 +1871,9 @@ class Libzot { // if it's a sourced post, call the post_local hooks as if it were // posted locally so that crosspost connectors will be triggered. + $item_source = check_item_source($arr['uid'], $arr); - if (check_item_source($arr['uid'], $arr) || ($channel['xchan_pubforum'] == 1)) { + if ($item_source || ($channel['xchan_pubforum'] == 1)) { /** * @hooks post_local * Called when an item has been posted on this machine via mod/item.php (also via API). @@ -1898,7 +1899,13 @@ class Libzot { if (post_is_importable($arr['uid'], $arr, $abook)) { $item_result = item_store($arr); if ($item_result['success']) { + $item_id = $item_result['item_id']; + + if ($item_source && in_array($item_result['item']['obj_type'], ['Event', ACTIVITY_OBJ_EVENT])) { + event_addtocal($item_id, $channel['channel_id']); + } + $parr = [ 'item_id' => $item_id, 'item' => $arr, -- cgit v1.2.3