From 477e9bd67a0d88b959af363739ab3f8469852f46 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Jul 2020 19:36:11 +0000 Subject: [PATCH 1/2] Selective probing for AP --- src/Model/ContactRelation.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Model/ContactRelation.php b/src/Model/ContactRelation.php index 06c25059fa..bc4a38b744 100644 --- a/src/Model/ContactRelation.php +++ b/src/Model/ContactRelation.php @@ -22,6 +22,7 @@ namespace Friendica\Model; use Friendica\Core\Logger; +use Friendica\Core\Protocol; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Protocol\ActivityPub; @@ -100,7 +101,13 @@ class ContactRelation return; } - $apcontact = APContact::getByURL($url); + if (in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) { + // The contact is (most likely) speaking AP, so updating is allowed + $apcontact = APContact::getByURL($url); + } else { + // The contact isn't obviously speaking AP, so we don't allow updating + $apcontact = APContact::getByURL($url, false); + } if (!empty($apcontact['followers']) && is_string($apcontact['followers'])) { $followers = ActivityPub::fetchItems($apcontact['followers']); From 3cc026b8a850fa196784d987d115f6da509cc4d0 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Jul 2020 19:45:35 +0000 Subject: [PATCH 2/2] Adding OStatus as well --- src/Model/ContactRelation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/ContactRelation.php b/src/Model/ContactRelation.php index bc4a38b744..dfbea17cb4 100644 --- a/src/Model/ContactRelation.php +++ b/src/Model/ContactRelation.php @@ -101,7 +101,7 @@ class ContactRelation return; } - if (in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) { + if (in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::OSTATUS])) { // The contact is (most likely) speaking AP, so updating is allowed $apcontact = APContact::getByURL($url); } else {