]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #10286 from annando/local-contacts-tombstone
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 22 May 2021 10:50:07 +0000 (06:50 -0400)
committerGitHub <noreply@github.com>
Sat, 22 May 2021 10:50:07 +0000 (06:50 -0400)
Don't delete local tombstone contacts

src/Model/Contact.php
src/Util/HTTPSignature.php

index 89325e0939fedcd860b0d8d21c27e2849386f590..4af1d9bb6d74347913248d19230fe60a30227da3 100644 (file)
@@ -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);
index 5fb4ab7337b93ddcd886302a7392e44d77ded320..584ac356fb9afb68656cd617cc0232145b441e39 100644 (file)
@@ -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;
                }