Merge pull request #10896 from annando/relationship

Don't degrade an existing relationship when following again
This commit is contained in:
Hypolite Petovan 2021-10-19 07:29:17 -04:00 committed by GitHub
commit 42be3c1224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2462,7 +2462,7 @@ class Contact
if (DBA::isResult($contact)) { if (DBA::isResult($contact)) {
// update contact // update contact
$new_relation = (($contact['rel'] == self::FOLLOWER) ? self::FRIEND : self::SHARING); $new_relation = (in_array($contact['rel'], [self::FOLLOWER, self::FRIEND]) ? self::FRIEND : self::SHARING);
$fields = ['rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false]; $fields = ['rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false];
self::update($fields, ['id' => $contact['id']]); self::update($fields, ['id' => $contact['id']]);