]> git.mxchange.org Git - friendica.git/blob - src/Worker/ProfileUpdate.php
Merge pull request #5903 from nupplaphil/move_module_acctlink
[friendica.git] / src / Worker / ProfileUpdate.php
1 <?php
2 /**
3  * @file src/Worker/ProfileUpdate.php
4  * @brief Send updated profile data to Diaspora and ActivityPub
5  */
6
7 namespace Friendica\Worker;
8
9 use Friendica\BaseObject;
10 use Friendica\Protocol\Diaspora;
11 use Friendica\Protocol\ActivityPub;
12 use Friendica\Core\Worker;
13
14 class ProfileUpdate {
15         public static function execute($uid = 0) {
16                 if (empty($uid)) {
17                         return;
18                 }
19
20                 $a = BaseObject::getApp();
21
22                 $inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid);
23
24                 foreach ($inboxes as $inbox) {
25                         logger('Profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG);
26                         Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
27                                 'APDelivery', Delivery::PROFILEUPDATE, '', $inbox, $uid);
28                 }
29
30                 Diaspora::sendProfile($uid);
31         }
32 }