]> git.mxchange.org Git - friendica.git/commitdiff
Fix unfollowing not showing on contact page
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 30 Oct 2022 20:40:21 +0000 (16:40 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 31 Oct 2022 19:30:23 +0000 (15:30 -0400)
- Deleted contact rows kept the relationship status which would keep showing
- Deleting contact rows would also not update the corresponding user-contact record

src/Content/Widget/VCard.php
src/Model/Contact.php

index 13bd6f29a97be19642f1f178786f328091a0ecd6..9794270e2685cb9348578840f930c2eef5befb56 100644 (file)
@@ -70,7 +70,7 @@ class VCard
                                $rel     = $contact['rel'];
                                $pending = $contact['pending'];
                        } else {
-                               $pcontact = Contact::selectFirst([], ['uid' => DI::userSession()->getLocalUserId(), 'uri-id' => $contact['uri-id']]);
+                               $pcontact = Contact::selectFirst([], ['uid' => DI::userSession()->getLocalUserId(), 'uri-id' => $contact['uri-id'], 'deleted' => false]);
 
                                $id      = $pcontact['id'] ?? 0;
                                $rel     = $pcontact['rel'] ?? Contact::NOTHING;
index b26f985202a9a8e5bfab022a7282b702e1db37f3..91e89b2f2f558f52be9e2241854e3ee47eed8649 100644 (file)
@@ -902,7 +902,7 @@ class Contact
                self::clearFollowerFollowingEndpointCache($contact['uid']);
 
                // Archive the contact
-               self::update(['archive' => true, 'network' => Protocol::PHANTOM, 'deleted' => true], ['id' => $id]);
+               self::update(['archive' => true, 'network' => Protocol::PHANTOM, 'rel' => self::NOTHING, 'deleted' => true], ['id' => $id]);
 
                if (!DBA::exists('contact', ['uri-id' => $contact['uri-id'], 'deleted' => false])) {
                        Avatar::deleteCache($contact);