From: Michael Vogel Date: Thu, 18 Feb 2021 23:15:41 +0000 (+0100) Subject: Merge pull request #9944 from MrPetovan/bug/9905-block-contact-not-found X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5f6d1b88b78fc5302bd8d97f16b567a7258c0a69;hp=1b90686fcd6ce2a58c8d606c34a2dc0e430eda7d;p=friendica.git Merge pull request #9944 from MrPetovan/bug/9905-block-contact-not-found Use correct Contact\User::setBlocked instead of Contact::block for /item/block endpoint --- diff --git a/mod/item.php b/mod/item.php index 8c256cfabd..7c11d7311a 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) | ]