fix mail permissions for AP comments which are DMs when comments not allowed

This commit is contained in:
Mike Macgirvin 2023-11-04 11:51:57 +11:00
parent b5d8d006dc
commit 711fc8c5b4

View file

@ -4273,7 +4273,8 @@ class Activity
public static function comment_allowed($channel, $item, $parent_item): bool|string
{
// First check if comment permissions have been granted to this author.
$allowed = perm_is_allowed($channel['channel_id'], $item['author_xchan'], 'post_comments');
$allowed = perm_is_allowed($channel['channel_id'], $item['author_xchan'],
(((int)$item['item_private'] === 2) ? 'post_mail' : 'post_comments'));
// Allow likes from strangers if permitted to do so. These are difficult (but not impossible) to spam.
if ($item['verb'] === 'Like' && PConfig::Get($channel['channel_id'], 'system', 'permit_all_likes') && $item['obj_type'] === 'Note') {