X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateContact.php;h=67bc45ef982d229798a70bc572b57bfba33863c9;hb=4e900292344a973a2bbf28634722b60d36f1deb5;hp=ae3b06b5067dc5ee2b0e22293ac2c5a2d8bf6387;hpb=90eea919a42c6d2dc40afd967a9dcf6ebae4e22a;p=friendica.git diff --git a/src/Worker/UpdateContact.php b/src/Worker/UpdateContact.php index ae3b06b506..67bc45ef98 100644 --- a/src/Worker/UpdateContact.php +++ b/src/Worker/UpdateContact.php @@ -1,28 +1,42 @@ . + * */ namespace Friendica\Worker; use Friendica\Core\Logger; use Friendica\Model\Contact; -use Friendica\Util\DateTimeFormat; -use Friendica\Database\DBA; class UpdateContact { - public static function execute($contact_id) + /** + * Update contact data via probe + * @param int $contact_id Contact ID + * @param string $command + */ + public static function execute($contact_id, $command = '') { - $success = Contact::updateFromProbe($contact_id); - // Update the "updated" field if the contact could be probed. - // We don't do this in the function above, since we don't want to - // update the contact whenever that function is called from anywhere. - if ($success) { - DBA::update('contact', ['updated' => DateTimeFormat::utcNow()], ['id' => $contact_id]); - } + $force = ($command == "force"); + + $success = Contact::updateFromProbe($contact_id, '', $force); - Logger::info('Updated from probe', ['id' => $contact_id, 'success' => $success]); + Logger::info('Updated from probe', ['id' => $contact_id, 'force' => $force, 'success' => $success]); } }