diff options
author | Mario <mario@mariovavti.com> | 2023-11-25 17:12:28 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-11-25 17:12:28 +0100 |
commit | 0fd8e02a884a2b040dca62ab5d9674db5f6a070b (patch) | |
tree | 586ee43f32f6f14368c09026f21dcd3244ea24b6 /Zotlabs/Daemon | |
parent | 82e704ec5b107823c09f1387e9091adee53a4c2d (diff) | |
parent | 55c4bfb67009c598f25b1a8189604bfffa73dfbb (diff) | |
download | volse-hubzilla-8.8.tar.gz volse-hubzilla-8.8.tar.bz2 volse-hubzilla-8.8.zip |
Merge branch '8.8RC'8.8
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 7 | ||||
-rw-r--r-- | Zotlabs/Daemon/Xchan_photo.php | 34 |
2 files changed, 40 insertions, 1 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 592dd2c38..4b74a7ba9 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -300,6 +300,11 @@ class Notifier { return; } + if ($target_item['verb'] === ACTIVITY_SHARE) { + // Provide correct representation across the wire. Internally this is treated as a comment. + $target_item['parent_mid'] = $target_item['thr_parent'] = $target_item['mid']; + } + if ($target_item['mid'] === $target_item['parent_mid']) { $parent_item = $target_item; $top_level_post = true; @@ -377,7 +382,7 @@ class Notifier { if (($relay_to_owner || $uplink) && ($cmd !== 'relay')) { logger('notifier: followup relay', LOGGER_DEBUG); - $sendto = (($uplink) ? $parent_item['source_xchan'] : $parent_item['owner_xchan']); + $sendto = (($uplink) ? $parent_item['source_xchan'] : (($parent_item['verb'] === ACTIVITY_SHARE) ? $parent_item['author_xchan'] : $parent_item['owner_xchan'])); self::$recipients = [$sendto]; self::$private = true; $upstream = true; diff --git a/Zotlabs/Daemon/Xchan_photo.php b/Zotlabs/Daemon/Xchan_photo.php new file mode 100644 index 000000000..f90d1d726 --- /dev/null +++ b/Zotlabs/Daemon/Xchan_photo.php @@ -0,0 +1,34 @@ +<?php + +/** @file */ + +namespace Zotlabs\Daemon; + +class Xchan_photo { + + static public function run($argc, $argv) { + + if ($argc != 3) { + return; + } + + $url = hex2bin($argv[1]); + $xchan = hex2bin($argv[2]); + + $photos = import_xchan_photo($url, $xchan); + if ($photos) { + $result = q("update xchan set xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s'", + dbescdate(datetime_convert()), + dbesc($photos[0]), + dbesc($photos[1]), + dbesc($photos[2]), + dbesc($photos[3]), + dbesc($xchan) + ); + + if (! $result) { + logger("xchan update failed for $url"); + } + } + } +} |