+ /**
+ * @brief Transmits a profile deletion to a given inbox
+ *
+ * @param integer $uid User ID
+ * @param string $inbox Target inbox
+ */
+ public static function transmitProfileDeletion($uid, $inbox)
+ {
+ $owner = User::getOwnerDataById($uid);
+ $profile = APContact::getByURL($owner['url']);
+
+ $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
+ 'id' => System::baseUrl() . '/activity/' . System::createGUID(),
+ 'type' => 'Delete',
+ 'actor' => $owner['url'],
+ 'object' => self::profile($uid),
+ 'published' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
+ 'to' => [self::PUBLIC_COLLECTION],
+ 'cc' => []];
+
+ $signed = LDSignature::sign($data, $owner);
+
+ logger('Deliver profile deletion for user ' . $uid . ' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG);
+ HTTPSignature::transmit($signed, $inbox, $uid);
+ }
+
+ /**
+ * @brief Transmits a profile change to a given inbox
+ *
+ * @param integer $uid User ID
+ * @param string $inbox Target inbox
+ */
+ public static function transmitProfileUpdate($uid, $inbox)
+ {
+ $owner = User::getOwnerDataById($uid);
+ $profile = APContact::getByURL($owner['url']);
+
+ $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
+ 'id' => System::baseUrl() . '/activity/' . System::createGUID(),
+ 'type' => 'Update',
+ 'actor' => $owner['url'],
+ 'object' => self::profile($uid),
+ 'published' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
+ 'to' => [$profile['followers']],
+ 'cc' => []];
+
+ $signed = LDSignature::sign($data, $owner);
+
+ logger('Deliver profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG);
+ HTTPSignature::transmit($signed, $inbox, $uid);
+ }
+
+ /**
+ * @brief Transmits a given activity to a target
+ *
+ * @param array $activity
+ * @param string $target Target profile
+ * @param integer $uid User ID
+ */