+ * Creates an announce object entry
+ *
+ * @param array $item
+ *
+ * @return string with announced object url
+ */
+ public static function createAnnounce($item)
+ {
+ $announce = api_share_as_retweet($item);
+ if (empty($announce['plink'])) {
+ return self::createNote($item);
+ }
+
+ return $announce['plink'];
+ }
+
+ /**
+ * Transmits a contact suggestion to a given inbox
+ *
+ * @param integer $uid User ID
+ * @param string $inbox Target inbox
+ * @param integer $suggestion_id Suggestion ID
+ */
+ public static function sendContactSuggestion($uid, $inbox, $suggestion_id)
+ {
+ $owner = User::getOwnerDataById($uid);
+ $profile = APContact::getByURL($owner['url']);
+
+ $suggestion = DBA::selectFirst('fsuggest', ['url', 'note', 'created'], ['id' => $suggestion_id]);
+
+ $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
+ 'id' => System::baseUrl() . '/activity/' . System::createGUID(),
+ 'type' => 'Announce',
+ 'actor' => $owner['url'],
+ 'object' => $suggestion['url'],
+ 'content' => $suggestion['note'],
+ 'instrument' => ['type' => 'Service', 'name' => BaseObject::getApp()->getUserAgent()],
+ 'to' => [ActivityPub::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);
+ }
+
+ /**
+ * Transmits a profile deletion to a given inbox