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);
|
$scope = self::getScope($activity, $url);
|
||||||
$cw = self::getSensitive($activity, $url);
|
$cw = self::getSensitive($activity, $url);
|
||||||
$pid = is_object($profile) ? $profile->id : (is_array($profile) ? $profile['id'] : null);
|
$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;
|
$commentsDisabled = isset($activity['commentsEnabled']) ? !boolval($activity['commentsEnabled']) : false;
|
||||||
|
|
||||||
if(!$pid) {
|
if(!$pid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($scope == 'public') {
|
||||||
|
if($isUnlisted == true) {
|
||||||
|
$scope = 'unlisted';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$status = Status::updateOrCreate(
|
$status = Status::updateOrCreate(
|
||||||
[
|
[
|
||||||
'uri' => $url
|
'uri' => $url
|
||||||
|
@ -519,9 +526,11 @@ class Helpers {
|
||||||
->values()
|
->values()
|
||||||
->toArray();
|
->toArray();
|
||||||
if(!in_array($urlDomain, $filteredDomains)) {
|
if(!in_array($urlDomain, $filteredDomains)) {
|
||||||
|
if(!$isUnlisted) {
|
||||||
NetworkTimelineService::add($status->id);
|
NetworkTimelineService::add($status->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IncrementPostCount::dispatch($pid)->onQueue('low');
|
IncrementPostCount::dispatch($pid)->onQueue('low');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue