X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContact.php;h=c2e443282056381cae6594c1c88d7a618e1d7e1f;hb=f609e38600f54fe8465d1194008d823103f41baa;hp=790badc9d2d3e2510f49416c4e568c22ed4a075f;hpb=53e38b03130ea798bba44db44ccb7f331dc4b91d;p=friendica.git diff --git a/src/Worker/UpdateContact.php b/src/Worker/UpdateContact.php index 790badc9d2..c2e4432820 100644 --- a/src/Worker/UpdateContact.php +++ b/src/Worker/UpdateContact.php @@ -1,6 +1,6 @@ $contact_id, 'success' => $success]); } + + /** + * @param array|int $run_parameters Priority constant or array of options described in Worker::add + * @param int $contact_id + * @return int + * @throws InternalServerErrorException + */ + public static function add($run_parameters, int $contact_id): int + { + if (!$contact_id) { + 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); + } }