groups refactor

This commit is contained in:
Mike Macgirvin 2023-08-05 06:11:24 +10:00
parent 057be90193
commit 833d6b6507
5 changed files with 16 additions and 18 deletions

View file

@ -872,10 +872,10 @@ class Activity
return []; return [];
} }
$replyTo = unserialise($item['replyto']);
$replyto = unserialise($item['replyto']); if ($replyTo) {
if ($replyto) { $activity['replyTo'] = $replyTo;
$activity['replyTo'] = $replyto; $activity['audience'] = $replyTo;
} }
if (!isset($activity['url'])) { if (!isset($activity['url'])) {
@ -1294,9 +1294,10 @@ class Activity
} }
} }
$replyto = unserialise($item['replyto']); $replyTo = unserialise($item['replyto']);
if ($replyto) { if ($replyTo) {
$activity['replyTo'] = $replyto; $activity['replyTo'] = $replyTo;
$activity['audience'] = $replyTo;
} }
if (!isset($activity['url'])) { if (!isset($activity['url'])) {
@ -2942,6 +2943,7 @@ class Activity
$s['mid'] = $s['parent_mid'] = $act->id; $s['mid'] = $s['parent_mid'] = $act->id;
} }
if (isset($act->replyto) && !empty($act->replyto)) { if (isset($act->replyto) && !empty($act->replyto)) {
if (is_array($act->replyto) && isset($act->replyto['id'])) { if (is_array($act->replyto) && isset($act->replyto['id'])) {
$s['replyto'] = $act->replyto['id']; $s['replyto'] = $act->replyto['id'];

View file

@ -109,7 +109,10 @@ class ActivityStreams
$this->tgt = $this->get_compound_property('target'); $this->tgt = $this->get_compound_property('target');
$this->origin = $this->get_compound_property('origin'); $this->origin = $this->get_compound_property('origin');
$this->recips = $this->collect_recips(); $this->recips = $this->collect_recips();
$this->replyto = $this->get_property_obj('replyTo'); $this->replyto = $this->get_property_obj('audience');
if (!$this->replyto) {
$this->replyto = $this->get_property_obj('replyTo');
}
$this->ldsig = $this->get_compound_property('signature'); $this->ldsig = $this->get_compound_property('signature');
if ($this->ldsig) { if ($this->ldsig) {
@ -362,7 +365,7 @@ class ActivityStreams
* of the elements are a known actor type * of the elements are a known actor type
* *
* @param array|string $type * @param array|string $type
* @return boolean * @return bool
*/ */
public static function is_an_actor(mixed $type): bool public static function is_an_actor(mixed $type): bool

View file

@ -964,13 +964,6 @@ class Item extends Controller
$groupww = true; $groupww = true;
$str_contact_allow = $owner_xchan['xchan_hash']; $str_contact_allow = $owner_xchan['xchan_hash'];
$str_group_allow = ''; $str_group_allow = '';
$datarray['target'] = [
'id' => z_root() . '/outbox/' . $channel['channel_address'],
'type' => 'Collection',
'attributedTo' => ((in_array($owner_xchan['xchan_network'], ['zot6', 'nomad'])) ? $owner_xchan['xchan_url'] : $owner_xchan['xchan_hash'])
];
$datarray['tgt_type'] = 'Collection';
} }
if (!strlen($verb)) { if (!strlen($verb)) {

View file

@ -3044,7 +3044,7 @@ function start_delivery_chain($channel, $item, $item_id, bool|array $parent, $gr
$arr['obj_type'] = $item['obj_type']; $arr['obj_type'] = $item['obj_type'];
$arr['verb'] = 'Add'; $arr['verb'] = 'Create';
$arr['item_restrict'] = 1; $arr['item_restrict'] = 1;

View file

@ -967,7 +967,7 @@ function liveUpdate(notify_id) {
if((src === null) || (! profile_uid)) { $('.like-rotator').hide(); return; } if((src === null) || (! profile_uid)) { $('.like-rotator').hide(); return; }
if(in_progress || mediaPlaying || expanded.length || stopped) { if(in_progress || mediaPlaying || stopped) {
console.log('liveUpdate: deferred'); console.log('liveUpdate: deferred');
if(livetime) { if(livetime) {
clearTimeout(livetime); clearTimeout(livetime);