Update AP Helpers, preserve admin unlisted state before adding to NetworkTimelineService

This commit is contained in:
Daniel Supernault 2023-07-14 01:20:26 -06:00
parent 9fa6b3f7aa
commit 0704c7e05e
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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');