lemmy comment controls

This commit is contained in:
Mike Macgirvin 2024-06-28 12:28:06 +10:00
parent d9e3e8430c
commit 1e7d61af9c

View file

@ -3320,6 +3320,11 @@ class Activity
$item['edited'] = $item['created'];
}
// lemmy comment controls
if (isset($act->obj['commentEnabled']) && !$act->obj['commentsEnabled']) {
$item['comment_policy'] = 'none';
}
if ($item['mid'] === $item['parent_mid']) {
// it is a parent node - decode the comment policy info if present
if ($act->objprop('commentPolicy')) {
@ -4680,6 +4685,17 @@ class Activity
$item['body'] .= "\n\n" . '[audio]' . $a['href'] . '[/audio]';
}
}
if (array_key_exists('type', $a) && stripos($a['type'], 'link') !== false) {
if (ActivityStreams::is_url($a['href']) && !strpos($item['body'], $a['href'])) {
$li = Url::get(z_root() . '/linkinfo?binurl=' . bin2hex($a['href']));
if ($li['success'] && $li['body']) {
$item['body'] .= "\n" . $li['body'];
} else {
$item['body'] .= "\n\n" . $a['href'];
}
}
}
if (array_key_exists('type', $a) && stripos($a['type'], 'activity') !== false) {
if (self::share_not_in_body($item['body'])) {
$item = self::get_quote($a['href'], $item);