AP: Automatically send follow requests for reshared items

This commit is contained in:
Michael 2019-01-30 21:33:23 +00:00
parent fc0acd7b1f
commit a7963fe18a
3 changed files with 25 additions and 1 deletions

View file

@ -329,6 +329,15 @@ class Processor
$item_id = Item::insert($item);
Logger::log('Storing for user ' . $item['uid'] . ': ' . $item_id);
}
if (!$item['private'] && ($item['gravity'] == GRAVITY_PARENT) && ($item['author-link'] != $item['owner-link'])) {
$author = APContact::getByURL($item['owner-link'], false);
// We send automatic follow requests for reshared messages. (We don't need though for forum posts)
if ($author['type'] != 'Group') {
Logger::log('Send follow request for ' . $item['uri'] . ' to ' . $item['author-link'], Logger::DEBUG);
ActivityPub\Transmitter::sendFollowObject($item['uri'], $item['author-link']);
}
}
}
/**