Remove contact record instead of setting rel = 0 in Contact::revokeFollow

This commit is contained in:
Hypolite Petovan 2021-10-02 15:48:52 -04:00
parent c4a4473cd0
commit b0d8136b00

View 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;