Update AP handler, deliver unlisted and followers-only posts

This commit is contained in:
Daniel Supernault 2019-08-06 21:36:36 -06:00
parent fe36cf60d0
commit 14d43c2a7e
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 14 additions and 1 deletions

View file

@ -57,7 +57,7 @@ class StatusActivityPubDeliver implements ShouldQueue
$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;
}

View file

@ -379,12 +379,25 @@ class Status extends Model
break;
case 'unlisted':
$res['to'] = [
$this->profile->permalink('/followers')
];
$res['cc'] = [
"https://www.w3.org/ns/activitystreams#Public"
];
break;
case 'private':
$res['to'] = [
$this->profile->permalink('/followers')
];
$res['cc'] = [];
break;
// TODO: Update scope when DMs are supported
case 'direct':
$res['to'] = [];
$res['cc'] = [];
break;
}
return $res[$audience];