mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update AP Helpers, preserve admin unlisted state before adding to NetworkTimelineService
This commit is contained in:
parent
9fa6b3f7aa
commit
0704c7e05e
1 changed files with 730 additions and 721 deletions
|
@ -466,12 +466,19 @@ class Helpers {
|
|||
$scope = self::getScope($activity, $url);
|
||||
$cw = self::getSensitive($activity, $url);
|
||||
$pid = is_object($profile) ? $profile->id : (is_array($profile) ? $profile['id'] : null);
|
||||
$isUnlisted = is_object($profile) ? $profile->unlisted : (is_array($profile) ? $profile['unlisted'] : false);
|
||||
$commentsDisabled = isset($activity['commentsEnabled']) ? !boolval($activity['commentsEnabled']) : false;
|
||||
|
||||
if(!$pid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if($scope == 'public') {
|
||||
if($isUnlisted == true) {
|
||||
$scope = 'unlisted';
|
||||
}
|
||||
}
|
||||
|
||||
$status = Status::updateOrCreate(
|
||||
[
|
||||
'uri' => $url
|
||||
|
@ -519,9 +526,11 @@ class Helpers {
|
|||
->values()
|
||||
->toArray();
|
||||
if(!in_array($urlDomain, $filteredDomains)) {
|
||||
if(!$isUnlisted) {
|
||||
NetworkTimelineService::add($status->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IncrementPostCount::dispatch($pid)->onQueue('low');
|
||||
|
||||
|
|
Loading…
Reference in a new issue