Ensure that local contacts always are DFRN contacts

This commit is contained in:
Michael 2020-01-16 06:43:21 +00:00
parent 7db4c7ea02
commit ccc7a71e54
5 changed files with 52 additions and 9 deletions

View file

@ -857,13 +857,13 @@ class Processor
*/
private static function switchContact($cid)
{
$contact = DBA::selectFirst('contact', ['network'], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]);
if (!DBA::isResult($contact) || in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) {
$contact = DBA::selectFirst('contact', ['network', 'url'], ['id' => $cid]);
if (!DBA::isResult($contact) || in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN]) || Contact::isLocal($contact['url'])) {
return;
}
Logger::log('Change existing contact ' . $cid . ' from ' . $contact['network'] . ' to ActivityPub.');
Contact::updateFromProbe($cid, Protocol::ACTIVITYPUB);
Logger::info('Change existing contact', ['cid' => $cid, 'previous' => $contact['network']]);
Contact::updateFromProbe($cid);
}
/**