Added the option to only receive top level posts from people you follow

This commit is contained in:
Michael 2019-07-17 21:37:13 +00:00
parent a80a6bec74
commit e247a14d2b
6 changed files with 89 additions and 5 deletions

View file

@ -425,6 +425,21 @@ class Processor
continue;
}
if (PConfig::get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) {
$skip = !Contact::isSharingByURL($activity['author'], $receiver);
if ($skip && (($activity['type'] == 'as:Announce') || $isForum)) {
$skip = !Contact::isSharingByURL($activity['actor'], $receiver);
}
if ($skip) {
Logger::info('Skipping post', ['uid' => $receiver, 'url' => $item['uri']]);
continue;
}
Logger::info('Accepting post', ['uid' => $receiver, 'url' => $item['uri']]);
}
if ($activity['object_type'] == 'as:Event') {
self::createEvent($activity, $item);
}
@ -524,10 +539,6 @@ class Processor
*/
public static function fetchMissingActivity($url, $child = [])
{
if (Config::get('system', 'ostatus_full_threads')) {
return;
}
if (!empty($child['receiver'])) {
$uid = ActivityPub\Receiver::getFirstUserFromReceivers($child['receiver']);
} else {