);
} else {
if ($network == Protocol::ACTIVITYPUB) {
- ActivityPub::transmitContactAccept($contact['url'], $contact['hub-verify'], $uid);
+ ActivityPub\Transmitter::sendContactAccept($contact['url'], $contact['hub-verify'], $uid);
$pending = true;
} else {
$pending = false;
$new_relation = $contact['rel'];
$writable = $contact['writable'];
- if ($network === Protocol::DIASPORA) {
+ if (in_array($network, [Protocol::DIASPORA, Protocol::ACTIVITYPUB])) {
if ($duplex) {
$new_relation = Contact::FRIEND;
} else {
Group::addMember(User::getDefaultGroup($uid, $contact["network"]), $contact['id']);
+ if ($network == Protocol::ACTIVITYPUB && $duplex) {
+ ActivityPub\Transmitter::sendActivity('Follow', $contact['url'], $uid);
+ }
+
// Let's send our user to the contact editor in case they want to
// do anything special with this new friend.
if ($handsfree === null) {