aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-09-28 16:55:49 +0000
committerMario <mario@mariovavti.com>2023-09-28 16:55:49 +0000
commit56e54ac820b32f4b5f7d3f554191079003ac78a5 (patch)
tree0ee7de8c1bd3523d8b84399d3a4b28aaf5f696bf /Zotlabs/Lib/Libzot.php
parent08d85798ed431e20ce391636a7bff7d4a5e7830e (diff)
downloadvolse-hubzilla-56e54ac820b32f4b5f7d3f554191079003ac78a5.tar.gz
volse-hubzilla-56e54ac820b32f4b5f7d3f554191079003ac78a5.tar.bz2
volse-hubzilla-56e54ac820b32f4b5f7d3f554191079003ac78a5.zip
if the item is sourced and provides an event add it to the calendar
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php9
1 files changed, 8 insertions, 1 deletions
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,