From 2a909516e2b11a144e809e45ecfa20edfa26c41a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 18 Feb 2021 18:05:23 -0500 Subject: [PATCH] Use correct Contact\User::setBlocked instead of Contact::block for /item/block endpoint --- mod/item.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mod/item.php b/mod/item.php index 8c256cfab..7c11d7311 100644 --- a/mod/item.php +++ b/mod/item.php @@ -847,12 +847,7 @@ function item_content(App $a) throw new HTTPException\NotFoundException('Item not found'); } - $cdata = Contact::getPublicAndUserContacID($item['author-id'], local_user()); - if (empty($cdata['user'])) { - throw new HTTPException\NotFoundException('Contact not found'); - } - - Contact::block($cdata['user'], DI::l10n()->t('Blocked on item with guid %s', $item['guid'])); + Contact\User::setBlocked($item['author-id'], local_user(), true); if (DI::mode()->isAjax()) { // ajax return: [, 0 (no perm) | ]