From: Hypolite Petovan Date: Sun, 19 May 2019 22:46:58 +0000 (-0400) Subject: Prevent contact relationships with node- or user-level blocked contacts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=62dfcbb07436b69ae3965458cd0dd0855992d33f;p=friendica.git Prevent contact relationships with node- or user-level blocked contacts --- diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 18b60d2121..625c66b199 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2137,13 +2137,18 @@ class Contact extends BaseObject return false; } - $fields = ['url', 'name', 'nick', 'photo', 'network']; + $fields = ['url', 'name', 'nick', 'photo', 'network', 'blocked']; $pub_contact = DBA::selectFirst('contact', $fields, ['id' => $datarray['author-id']]); if (!DBA::isResult($pub_contact)) { // Should never happen return false; } + // Contact is blocked on node-level or user-level + if (!empty($pub_contact['blocked']) || !empty($contact['blocked'])) { + return false; + } + $url = defaults($datarray, 'author-link', $pub_contact['url']); $name = $pub_contact['name']; $photo = $pub_contact['photo'];