mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 01:55:13 +00:00
fix some AP addressing quirks
This commit is contained in:
parent
61fcdea04b
commit
aea980fc3d
2 changed files with 12 additions and 1 deletions
|
@ -1942,7 +1942,7 @@ function addToCollectionAndSync($ret)
|
|||
return $ret;
|
||||
}
|
||||
$channel = Channel::from_id($ret['item']['uid']);
|
||||
if ($channel && $channel['channel_hash'] === $ret['item']['owner_xchan']) {
|
||||
if ($channel && $channel['channel_hash'] === $ret['item']['owner_xchan'] && !((int)$ret['item']['item_restrict'] & 1)) {
|
||||
$items = [$ret['item']];
|
||||
if ((int)$items[0]['item_blocked'] === ITEM_MODERATED
|
||||
|| (int)$items[0]['item_unpublished'] || (int)$items[0]['item_delayed']) {
|
||||
|
|
|
@ -1031,6 +1031,7 @@ class Activity
|
|||
// addressing madness
|
||||
|
||||
if ($activitypub) {
|
||||
$postopts = explode(',', $item['postopts']);
|
||||
$parent_i = [];
|
||||
$public = !$item['item_private'];
|
||||
$top_level = ($item['mid'] === $item['parent_mid']);
|
||||
|
@ -1081,6 +1082,11 @@ class Activity
|
|||
$activity['cc'][] = $addr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$myfollowers = z_root() . '/followers/' . substr($item['author']['xchan_addr'], 0, strpos($item['author']['xchan_addr'], '@'));
|
||||
if (in_array('followers', $postopts) && !in_array($myfollowers, $activity['cc'])) {
|
||||
$activity['cc'][] = $myfollowers;
|
||||
}
|
||||
|
||||
$mentions = self::map_mentions($item);
|
||||
|
@ -1390,6 +1396,7 @@ class Activity
|
|||
// addressing madness
|
||||
|
||||
if ($activitypub) {
|
||||
$postopts = explode(',', $item['postopts']);
|
||||
$parent_i = [];
|
||||
$activity['to'] = [];
|
||||
$activity['cc'] = [];
|
||||
|
@ -1459,6 +1466,10 @@ class Activity
|
|||
}
|
||||
}
|
||||
}
|
||||
$myfollowers = z_root() . '/followers/' . substr($item['author']['xchan_addr'], 0, strpos($item['author']['xchan_addr'], '@'));
|
||||
if (in_array('followers', $postopts) && !in_array($myfollowers, $activity['cc'])) {
|
||||
$activity['cc'][] = $myfollowers;
|
||||
}
|
||||
|
||||
$mentions = self::map_mentions($item);
|
||||
if (count($mentions) > 0) {
|
||||
|
|
Loading…
Reference in a new issue