X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContact.php;h=c2e443282056381cae6594c1c88d7a618e1d7e1f;hb=f609e38600f54fe8465d1194008d823103f41baa;hp=633058428d4ae70a98c25c927f64ab816df6cae7;hpb=931ccde90d5b27d9fcc91504c0825fc70d0f1ffc;p=friendica.git diff --git a/src/Worker/UpdateContact.php b/src/Worker/UpdateContact.php index 633058428d..c2e4432820 100644 --- a/src/Worker/UpdateContact.php +++ b/src/Worker/UpdateContact.php @@ -25,6 +25,7 @@ use Friendica\Core\Logger; use Friendica\Core\Worker; use Friendica\Model\Contact; use Friendica\Network\HTTPException\InternalServerErrorException; +use Friendica\Util\Network; class UpdateContact { @@ -38,6 +39,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 +61,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); } }