]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/UpdateContact.php
Merge pull request #13383 from annando/baseurl
[friendica.git] / src / Worker / UpdateContact.php
index a20642f0a75f98c3e3557e96454b71ab1bb09343..23eb5ff4bac37f32f5041ba56ee133a5985857f0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -38,6 +38,11 @@ class UpdateContact
         */
        public static function execute(int $contact_id)
        {
+               // Silently dropping the task if the contact is blocked
+               if (Contact::isBlocked($contact_id)) {
+                       return;
+               }
+
                $success = Contact::updateFromProbe($contact_id);
 
                Logger::info('Updated from probe', ['id' => $contact_id, 'success' => $success]);
@@ -55,6 +60,11 @@ class UpdateContact
                        throw new \InvalidArgumentException('Invalid value provided for contact_id');
                }
 
+               // Dropping the task if the contact is blocked
+               if (Contact::isBlocked($contact_id)) {
+                       return 0;
+               }
+
                return Worker::add($run_parameters, 'UpdateContact', $contact_id);
        }
 }