+ $protocol = $protocol ?? $contact['protocol'];
+
+ if (in_array($protocol, [Protocol::OSTATUS, Protocol::DFRN])) {
+ // create a follow slap
+ $item = [
+ 'verb' => Activity::FOLLOW,
+ 'gravity' => Item::GRAVITY_ACTIVITY,
+ 'follow' => $contact['url'],
+ 'body' => '',
+ 'title' => '',
+ 'guid' => '',
+ 'uri-id' => 0,
+ ];
+
+ $slap = OStatus::salmon($item, $owner);
+
+ if (!empty($contact['notify'])) {
+ Salmon::slapper($owner, $contact['notify'], $slap);
+ }
+ } elseif ($protocol == Protocol::DIASPORA) {
+ $contact = Diaspora::sendShare($owner, $contact);
+ Logger::notice('share returns: ' . $contact);
+ } elseif ($protocol == Protocol::ACTIVITYPUB) {
+ $activity_id = ActivityPub\Transmitter::activityIDFromContact($contact['id']);
+ if (empty($activity_id)) {
+ // This really should never happen
+ return false;
+ }
+
+ $success = ActivityPub\Transmitter::sendActivity('Follow', $contact['url'], $owner['uid'], $activity_id);
+ Logger::notice('Follow returns: ' . $success);