]> git.mxchange.org Git - friendica.git/commitdiff
Don't degrade an existing relationship when following again
authorMichael <heluecht@pirati.ca>
Tue, 19 Oct 2021 02:05:04 +0000 (02:05 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 19 Oct 2021 02:05:04 +0000 (02:05 +0000)
src/Model/Contact.php

index 9aed40cf598b6261028cc7685e5e99fb88f1275d..f0b6eda55e5f50cd7277bc46bfafcffee5232bca 100644 (file)
@@ -2462,7 +2462,7 @@ class Contact
 
                if (DBA::isResult($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];
                        self::update($fields, ['id' => $contact['id']]);