diff options
author | Mario Vavti <mario@mariovavti.com> | 2024-11-08 22:24:33 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2024-11-08 22:24:33 +0100 |
commit | ebad9d56c9e9396847a66c07124e863cc2940b3c (patch) | |
tree | 427bf605076aaa25d3f3751d91fe97a4c5e6a462 /include/photos.php | |
parent | 0481901b593f861366f9a766e0f020cce7a31be7 (diff) | |
download | volse-hubzilla-ebad9d56c9e9396847a66c07124e863cc2940b3c.tar.gz volse-hubzilla-ebad9d56c9e9396847a66c07124e863cc2940b3c.tar.bz2 volse-hubzilla-ebad9d56c9e9396847a66c07124e863cc2940b3c.zip |
port to containers item_store() continued
Diffstat (limited to 'include/photos.php')
-rw-r--r-- | include/photos.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/photos.php b/include/photos.php index 85c97d1fd..511024107 100644 --- a/include/photos.php +++ b/include/photos.php @@ -541,14 +541,19 @@ function photo_upload($channel, $observer, $args) { // linked item from leaking into the feed when somebody has a channel with read_stream restrictions. $arr['public_policy'] = map_scope(PermissionLimits::Get($channel['channel_id'], 'view_stream'), true); - if ($arr['public_policy']) + + if ($arr['public_policy']) { $arr['item_private'] = 1; + } $result = item_store($arr, false, $deliver); - $item_id = $result['item_id']; - if ($visible && $deliver) - Zotlabs\Daemon\Master::Summon(['Notifier', 'wall-new', $item_id]); + if ($visible && $deliver) { + Master::Summon(['Notifier', 'wall-new', $result['item_id']]); + if (!empty($result['approval_id'])) { + Master::Summon(['Notifier', 'wall-new', $result['approval_id']]); + } + } } $ret['success'] = true; @@ -911,7 +916,7 @@ function photos_create_item($channel, $creator_hash, $photo, $visible = false) { . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-' . $photo['imgscale'] . '[/zmg]' . '[/zrl]'; - $result = item_store($arr); + $result = item_store($arr, deliver: false, addAndSync: true); $item_id = $result['item_id']; return $item_id; |