Skip to content

Commit

Permalink
Update ap helpers to handle disabled comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Sep 29, 2022
1 parent f925903 commit 92f56c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Util/ActivityPub/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ public static function storeStatus($url, $profile, $activity)
$scope = self::getScope($activity, $url);
$cw = self::getSensitive($activity, $url);
$pid = is_object($profile) ? $profile->id : (is_array($profile) ? $profile['id'] : null);
$commentsDisabled = isset($activity['commentsEnabled']) ? !boolval($activity['commentsEnabled']) : false;

if(!$pid) {
return;
Expand All @@ -490,7 +491,8 @@ public static function storeStatus($url, $profile, $activity)
'scope' => $scope,
'visibility' => $scope,
'cw_summary' => ($cw == true && isset($activity['summary']) ?
Purify::clean(strip_tags($activity['summary'])) : null)
Purify::clean(strip_tags($activity['summary'])) : null),
'comments_disabled' => $commentsDisabled
]
);

Expand Down

0 comments on commit 92f56c9

Please sign in to comment.