Merge pull request #8936 from annando/ap-probing

Selective probing for AP
pull/8937/head
Hypolite Petovan 2020-07-27 16:24:11 -04:00 zatwierdzone przez GitHub
commit aed879a086
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -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, Protocol::OSTATUS])) {
// 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']);