diff options
author | Mario <mario@mariovavti.com> | 2024-10-06 15:53:39 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-10-06 15:53:39 +0000 |
commit | 1988d21e6c64db1a93cc81f80409ce7d918aae7d (patch) | |
tree | a180c42074fd529b0ec608c5e304e1ccadd83639 /Zotlabs/Module/Item.php | |
parent | 19eeadfe5bafb8bdec3ac102d9b9f49593cc0933 (diff) | |
download | volse-hubzilla-1988d21e6c64db1a93cc81f80409ce7d918aae7d.tar.gz volse-hubzilla-1988d21e6c64db1a93cc81f80409ce7d918aae7d.tar.bz2 volse-hubzilla-1988d21e6c64db1a93cc81f80409ce7d918aae7d.zip |
start containers
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 5618137a1..c755fadd0 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -1029,18 +1029,44 @@ class Item extends Controller { } - if ($moderated) + if ($moderated) { $item_blocked = ITEM_MODERATED; + } - if (!strlen($verb)) + if (!strlen($verb)) { $verb = 'Create'; + } $notify_type = (($parent) ? 'comment-new' : 'wall-new'); $uuid = $uuid ?? $message_id ?? item_message_id(); $mid = $mid ?? z_root() . '/item/' . $uuid; + + // Set the conversation target. + if (empty($owner_hash)) { + $owner_hash = $owner_xchan['xchan_hash']; + } + + if ($owner_hash === $channel['channel_hash']) { + $attributedTo = z_root() . '/channel/' . $channel['channel_address']; + + $conversation = isset($parent_item) ? $parent_item['mid'] : $mid; + $datarray['target'] = [ + 'id' => str_replace('/item/', '/conversation/', $conversation), + 'type' => 'Collection', + 'attributedTo' => $attributedTo, + ]; + $datarray['tgt_type'] = 'Collection'; + } + elseif (!empty($parent_item['target'])) { + $datarray['target'] = $parent_item['target']; + $datarray['tgt_type'] = $parent_item['tgt_type']; + } + + + if ($is_poll) { $poll = [ 'question' => $body, @@ -1375,8 +1401,12 @@ class Item extends Controller { $nopush = false; } - if (!$nopush) - Master::Summon(['Notifier', $notify_type, $post_id]); + if (!$nopush) { + Master::Summon(['Notifier', $notify_type, $post_id]); + if (intval($post['approval_id'])) { + Master::Summon(['Notifier', $notify_type, $post['approval_id']]); + } + } logger('post_complete'); |