]> git.mxchange.org Git - friendica.git/commitdiff
Remove contact record instead of setting rel = 0 in Contact::revokeFollow
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 19:48:52 +0000 (15:48 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 21:30:03 +0000 (17:30 -0400)
src/Model/Contact.php

index bfbeb90024474132fa60320ef9955fc19eb0f274..faad2adc78c27c2cc91cfeabfc7e741752517535 100644 (file)
@@ -872,7 +872,11 @@ class Contact
                // A null value here means the remote network doesn't support explicit follow revocation, we can still
                // break the locally recorded relationship
                if ($result !== false) {
-                       DBA::update('contact', ['rel' => $contact['rel'] == self::FRIEND ? self::SHARING : self::NOTHING], ['id' => $contact['id']]);
+                       if ($contact['rel'] == self::FRIEND) {
+                               self::update(['rel' => self::SHARING], ['id' => $contact['id']]);
+                       } else {
+                               self::remove($contact['id']);
+                       }
                }
 
                return $result;