From 0c21588ab93c488e26615b2c50b88c261f9a762b Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 22 May 2021 08:25:30 +0000 Subject: [PATCH] Don't delete local tombstone contacts --- src/Model/Contact.php | 5 +++++ src/Util/HTTPSignature.php | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 89325e0939..4af1d9bb6d 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1941,6 +1941,11 @@ class Contact return false; } + if (Contact::isLocal($ret['url'])) { + Logger::info('Local contacts are not updated here.'); + return true; + } + if (!empty($ret['account-type']) && $ret['account-type'] == User::ACCOUNT_TYPE_DELETED) { Logger::info('Deleted account', ['id' => $id, 'url' => $ret['url'], 'ret' => $ret]); self::remove($id); diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index 5fb4ab7337..584ac356fb 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -558,8 +558,10 @@ class HTTPSignature if (!empty($key['url']) && !empty($key['type']) && ($key['type'] == 'Tombstone')) { Logger::info('Actor is a tombstone', ['key' => $key]); - // We now delete everything that we possibly knew from this actor - Contact::deleteContactByUrl($key['url']); + if (!Contact::isLocal($key['url'])) { + // We now delete everything that we possibly knew from this actor + Contact::deleteContactByUrl($key['url']); + } return null; }