friendica/src/Worker/ProfileUpdate.php

34 lines
825 B
PHP
Raw Normal View History

<?php
/**
* @file src/Worker/ProfileUpdate.php
2020-01-19 07:05:23 +01:00
* Send updated profile data to Diaspora and ActivityPub
*/
namespace Friendica\Worker;
2018-10-29 22:20:46 +01:00
use Friendica\Core\Logger;
use Friendica\Core\Worker;
use Friendica\DI;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\ActivityPub;
class ProfileUpdate {
public static function execute($uid = 0) {
if (empty($uid)) {
return;
}
$a = DI::app();
2018-10-03 11:15:38 +02:00
$inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid);
foreach ($inboxes as $inbox) {
Logger::log('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);
}
Diaspora::sendProfile($uid);
}
}