]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/ProfileUpdate.php
Improved comment
[friendica.git] / src / Worker / ProfileUpdate.php
index e33aa5d9a88ad6a2804d044f5242da1f8cbc4771..808d47299fe9455b034efee3999e6fffe1a4a4ae 100644 (file)
@@ -1,12 +1,16 @@
 <?php
 /**
  * @file src/Worker/ProfileUpdate.php
- * @brief Send updated profile data to Diaspora
+ * @brief Send updated profile data to Diaspora and ActivityPub
  */
 
 namespace Friendica\Worker;
 
+use Friendica\BaseObject;
+use Friendica\Core\Logger;
+use Friendica\Core\Worker;
 use Friendica\Protocol\Diaspora;
+use Friendica\Protocol\ActivityPub;
 
 class ProfileUpdate {
        public static function execute($uid = 0) {
@@ -14,6 +18,16 @@ class ProfileUpdate {
                        return;
                }
 
+               $a = BaseObject::getApp();
+
+               $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);
        }
 }