mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update ap helpers to handle disabled comments
This commit is contained in:
parent
f925903688
commit
92f56c9bc2
1 changed files with 3 additions and 1 deletions
|
@ -469,6 +469,7 @@ 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);
|
||||||
|
$commentsDisabled = isset($activity['commentsEnabled']) ? !boolval($activity['commentsEnabled']) : false;
|
||||||
|
|
||||||
if(!$pid) {
|
if(!$pid) {
|
||||||
return;
|
return;
|
||||||
|
@ -490,7 +491,8 @@ class Helpers {
|
||||||
'scope' => $scope,
|
'scope' => $scope,
|
||||||
'visibility' => $scope,
|
'visibility' => $scope,
|
||||||
'cw_summary' => ($cw == true && isset($activity['summary']) ?
|
'cw_summary' => ($cw == true && isset($activity['summary']) ?
|
||||||
Purify::clean(strip_tags($activity['summary'])) : null)
|
Purify::clean(strip_tags($activity['summary'])) : null),
|
||||||
|
'comments_disabled' => $commentsDisabled
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue