]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Merge pull request #7245 from annando/unify-constants
[friendica.git] / src / Model / Contact.php
index 18b60d2121090b09e7fd09229eef637b4660e70b..7e1d8c2ba5d9a174534df794fd619ff454dcb4d4 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 at node-level
+               if (self::isBlocked($datarray['author-id'])) {
+                       return false;
+               }
+
                $url = defaults($datarray, 'author-link', $pub_contact['url']);
                $name = $pub_contact['name'];
                $photo = $pub_contact['photo'];
@@ -2151,6 +2156,12 @@ class Contact extends BaseObject
                $network = $pub_contact['network'];
 
                if (!empty($contact)) {
+            // Contact is blocked at user-level
+                   if (!empty($contact['id']) && !empty($importer['id']) &&
+                       self::isBlockedByUser($contact['id'], $importer['id'])) {
+                       return false;
+            }
+
                        // Make sure that the existing contact isn't archived
                        self::unmarkForArchival($contact);