+ * @param string $target Target profile
+ * @param $id
+ * @param integer $uid User ID
+ */
+ public static function transmitContactAccept($target, $id, $uid)
+ {
+ $profile = APContact::getByURL($target);
+
+ $owner = User::getOwnerDataById($uid);
+ $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
+ 'id' => System::baseUrl() . '/activity/' . System::createGUID(),
+ 'type' => 'Accept',
+ 'actor' => $owner['url'],
+ 'object' => ['id' => $id, 'type' => 'Follow',
+ 'actor' => $profile['url'],
+ 'object' => $owner['url']],
+ 'to' => $profile['url']];
+
+ logger('Sending accept to ' . $target . ' for user ' . $uid . ' with id ' . $id, LOGGER_DEBUG);
+
+ $signed = LDSignature::sign($data, $owner);
+ HTTPSignature::transmit($signed, $profile['inbox'], $uid);
+ }
+
+ /**
+ * @brief
+ *
+ * @param string $target Target profile
+ * @param $id
+ * @param integer $uid User ID
+ */
+ public static function transmitContactReject($target, $id, $uid)
+ {
+ $profile = APContact::getByURL($target);
+
+ $owner = User::getOwnerDataById($uid);
+ $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
+ 'id' => System::baseUrl() . '/activity/' . System::createGUID(),
+ 'type' => 'Reject',
+ 'actor' => $owner['url'],
+ 'object' => ['id' => $id, 'type' => 'Follow',
+ 'actor' => $profile['url'],
+ 'object' => $owner['url']],
+ 'to' => $profile['url']];
+
+ logger('Sending reject to ' . $target . ' for user ' . $uid . ' with id ' . $id, LOGGER_DEBUG);
+
+ $signed = LDSignature::sign($data, $owner);
+ HTTPSignature::transmit($signed, $profile['inbox'], $uid);
+ }
+
+ /**
+ * @brief
+ *
+ * @param string $target Target profile
+ * @param integer $uid User ID
+ */
+ public static function transmitContactUndo($target, $uid)
+ {
+ $profile = APContact::getByURL($target);
+
+ $id = System::baseUrl() . '/activity/' . System::createGUID();
+
+ $owner = User::getOwnerDataById($uid);
+ $data = ['@context' => 'https://www.w3.org/ns/activitystreams',
+ 'id' => $id,
+ 'type' => 'Undo',
+ 'actor' => $owner['url'],
+ 'object' => ['id' => $id, 'type' => 'Follow',
+ 'actor' => $owner['url'],
+ 'object' => $profile['url']],
+ 'to' => $profile['url']];
+
+ logger('Sending undo to ' . $target . ' for user ' . $uid . ' with id ' . $id, LOGGER_DEBUG);
+
+ $signed = LDSignature::sign($data, $owner);
+ HTTPSignature::transmit($signed, $profile['inbox'], $uid);
+ }
+
+ /**
+ * Fetches ActivityPub content from the given url
+ *
+ * @param string $url content url