]> git.mxchange.org Git - friendica.git/commitdiff
Prevent contact relationships with node- or user-level blocked contacts
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 19 May 2019 22:46:58 +0000 (18:46 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 20 May 2019 19:29:20 +0000 (15:29 -0400)
src/Model/Contact.php

index 18b60d2121090b09e7fd09229eef637b4660e70b..625c66b199889536f78dc458163d29d117e2481d 100644 (file)
@@ -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'];