aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2024-11-10 11:40:56 +0100
committerMario Vavti <mario@mariovavti.com>2024-11-10 11:40:56 +0100
commite339fbcc464ee2cc2b6caa8e456ca59606828906 (patch)
tree4d6e5af8d8ea805b3fa6cb1b37db53b3ea1e8c67 /include/attach.php
parentc9d4b068c254bd58e6da5d6349ab8b7ae96b6054 (diff)
downloadvolse-hubzilla-e339fbcc464ee2cc2b6caa8e456ca59606828906.tar.gz
volse-hubzilla-e339fbcc464ee2cc2b6caa8e456ca59606828906.tar.bz2
volse-hubzilla-e339fbcc464ee2cc2b6caa8e456ca59606828906.zip
container fixes for photo and file upload
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/attach.php b/include/attach.php
index c8fde0cb7..15594ced8 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1941,6 +1941,12 @@ function attach_store_item($channel, $observer, $file) {
$mid = z_root() . '/item/' . $uuid;
+ $target = [
+ 'id' => z_root() . '/conversation/' . $uuid,
+ 'type' => 'Collection',
+ 'attributedTo' => channel_url($channel),
+ ];
+
$arr = []; // Initialize the array of parameters for the post
$arr['aid'] = $channel['channel_account_id'];
$arr['uuid'] = $uuid;
@@ -1961,6 +1967,8 @@ function attach_store_item($channel, $observer, $file) {
$arr['item_thread_top'] = 1;
$arr['item_private'] = (($file['allow_cid'] || $file['allow_gid'] || $file['deny_cid'] || $file['deny_gid']) ? 1 : 0);
$arr['verb'] = 'Create';
+ $arr['target'] = $target;
+ $arr['target_type'] = 'Collection';
$arr['obj_type'] = $type;
$arr['title'] = $file['filename'];
@@ -1978,7 +1986,7 @@ function attach_store_item($channel, $observer, $file) {
}
$body_str = sprintf((($type === 'Image') ? t('%s shared an %s with you') : t('%s shared a %s with you')), '[zrl=' . $observer['xchan_url'] . ']' . $observer['xchan_name'] . '[/zrl]', '[zrl=' . $path . ']' . (($type === 'Image') ? t('image') : t('file')) . '[/zrl]');
- $arr['body'] .= $body_str;
+ $arr['body'] .= "\r\n" . $body_str;
$meta = [
'name' => $file['filename'],