X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContact.php;h=c2e443282056381cae6594c1c88d7a618e1d7e1f;hb=4139134cfd2f86ba6fec2adef37bca16ab466514;hp=74fbe2c22a12bc53ca193704a7d74f371becd5a8;hpb=e23f7d5a35409778c04e7128916154b4c8974182;p=friendica.git diff --git a/src/Worker/UpdateContact.php b/src/Worker/UpdateContact.php index 74fbe2c22a..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); + } }