Merge pull request #5704 from MrPetovan/bug/fix-unfollow

Fix unfollow sharing-only contacts (except connector protocols)
This commit is contained in:
Michael Vogel 2018-08-31 15:40:51 +00:00 committed by GitHub
commit 196ef0111c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 108 additions and 99 deletions

View file

@ -596,17 +596,12 @@ function contacts_content(App $a, $update = 0)
/// @todo Only show the following link with DFRN when the remote version supports it
$follow = '';
$follow_text = '';
if (in_array($contact['network'], [Protocol::DIASPORA, Protocol::OSTATUS, Protocol::DFRN])) {
if (in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
if (in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
$follow = System::baseUrl(true) . "/unfollow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Disconnect/Unfollow");
} else {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Connect/Follow");
}
}
if ($contact['uid'] == 0) {
} else {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Connect/Follow");
}