mirror of
https://github.com/friendica/friendica
synced 2025-04-22 07:50:11 +00:00
Ensure that local contacts always are DFRN contacts
This commit is contained in:
parent
7db4c7ea02
commit
ccc7a71e54
5 changed files with 52 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue