mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Merge pull request #1571 from pixelfed/frontend-ui-refactor
Update AP handler, deliver unlisted and followers-only posts
This commit is contained in:
commit
4afced0e3a
2 changed files with 14 additions and 1 deletions
|
@ -57,7 +57,7 @@ class StatusActivityPubDeliver implements ShouldQueue
|
||||||
|
|
||||||
$audience = $status->profile->getAudienceInbox();
|
$audience = $status->profile->getAudienceInbox();
|
||||||
|
|
||||||
if(empty($audience) || $status->scope != 'public') {
|
if(empty($audience) || !in_array($status->scope, ['public', 'unlisted', 'private']) {
|
||||||
// Return on profiles with no remote followers
|
// Return on profiles with no remote followers
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -379,12 +379,25 @@ class Status extends Model
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'unlisted':
|
case 'unlisted':
|
||||||
|
$res['to'] = [
|
||||||
|
$this->profile->permalink('/followers')
|
||||||
|
];
|
||||||
|
$res['cc'] = [
|
||||||
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'private':
|
case 'private':
|
||||||
|
$res['to'] = [
|
||||||
|
$this->profile->permalink('/followers')
|
||||||
|
];
|
||||||
|
$res['cc'] = [];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// TODO: Update scope when DMs are supported
|
||||||
case 'direct':
|
case 'direct':
|
||||||
|
$res['to'] = [];
|
||||||
|
$res['cc'] = [];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $res[$audience];
|
return $res[$audience];
|
||||||
|
|
Loading…
Reference in a new issue