mirror of
https://github.com/friendica/friendica
synced 2025-04-28 00:30:10 +00:00
Merge pull request #8817 from annando/ap-diaspora-delivery
Prevent delivering AP comments to Diaspora
This commit is contained in:
commit
e78db3fac6
3 changed files with 60 additions and 9 deletions
|
@ -2332,13 +2332,24 @@ class Diaspora
|
|||
Logger::info('Participation stored', ['id' => $message_id, 'guid' => $guid, 'parent_guid' => $parent_guid, 'author' => $author]);
|
||||
|
||||
// Send all existing comments and likes to the requesting server
|
||||
$comments = Item::select(['id', 'uri-id', 'parent', 'verb'], ['parent' => $parent_item['id'], 'gravity' => [GRAVITY_COMMENT, GRAVITY_ACTIVITY]]);
|
||||
$comments = Item::select(['id', 'uri-id', 'parent-author-network', 'author-network', 'verb'],
|
||||
['parent' => $parent_item['id'], 'gravity' => [GRAVITY_COMMENT, GRAVITY_ACTIVITY]]);
|
||||
while ($comment = Item::fetch($comments)) {
|
||||
if (in_array($comment["verb"], [Activity::FOLLOW, Activity::TAG])) {
|
||||
if (in_array($comment['verb'], [Activity::FOLLOW, Activity::TAG])) {
|
||||
Logger::info('participation messages are not relayed', ['item' => $comment['id']]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($comment['author-network'] == Protocol::ACTIVITYPUB) {
|
||||
Logger::info('Comments from ActivityPub authors are not relayed', ['item' => $comment['id']]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($comment['parent-author-network'] == Protocol::ACTIVITYPUB) {
|
||||
Logger::info('Comments to comments from ActivityPub authors are not relayed', ['item' => $comment['id']]);
|
||||
continue;
|
||||
}
|
||||
|
||||
Logger::info('Deliver participation', ['item' => $comment['id'], 'contact' => $author_contact["cid"]]);
|
||||
if (Worker::add(PRIORITY_HIGH, 'Delivery', Delivery::POST, $comment['id'], $author_contact["cid"])) {
|
||||
Post\DeliveryData::incrementQueueCount($comment['uri-id'], 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue