X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FProfileUpdate.php;h=e26abf7e20e445fa36ddfa7ab69578dbb55a8857;hb=088a3b6bc429973381e6eb2931c6eacd5b8c8927;hp=cebc27ca55b83644e14242ac627954ced123d660;hpb=3ab837f3c783e14e2c8836e73c898041c47f2fd0;p=friendica.git diff --git a/src/Worker/ProfileUpdate.php b/src/Worker/ProfileUpdate.php index cebc27ca55..e26abf7e20 100644 --- a/src/Worker/ProfileUpdate.php +++ b/src/Worker/ProfileUpdate.php @@ -1,30 +1,62 @@ . + * */ namespace Friendica\Worker; -use Friendica\BaseObject; +use Friendica\Core\Logger; +use Friendica\Core\Worker; +use Friendica\DI; use Friendica\Protocol\Diaspora; use Friendica\Protocol\ActivityPub; -use Friendica\Core\Worker; +/** + * Send updated profile data to Diaspora and ActivityPub + */ class ProfileUpdate { - public static function execute($uid = 0) { + /** + * Sends updated profile data to Diaspora and ActivityPub + * + * @param int $uid User id (optional, default: 0) + * @return void + */ + public static function execute(int $uid = 0) + { if (empty($uid)) { return; } - $a = BaseObject::getApp(); + $a = DI::app(); $inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid); - foreach ($inboxes as $inbox) { - logger('Profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG); - Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true], - 'APDelivery', Delivery::PROFILEUPDATE, '', $inbox, $uid); + foreach ($inboxes as $inbox => $receivers) { + Logger::info('Profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub'); + Worker::add(['priority' => $a->getQueueValue('priority'), 'created' => $a->getQueueValue('created'), 'dont_fork' => true], + 'APDelivery', + Delivery::PROFILEUPDATE, + 0, + $inbox, + $uid, + $receivers + ); } Diaspora::sendProfile($uid);