Merge pull request #6192 from MrPetovan/bug/6012-fix-contact-relationship-links

Fix display of Connect/Disconnect links on contact page
This commit is contained in:
Michael Vogel 2018-11-23 20:51:40 +01:00 committed by GitHub
commit 170a61898b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -570,12 +570,12 @@ class Contact extends BaseModule
/// @todo Only show the following link with DFRN when the remote version supports it /// @todo Only show the following link with DFRN when the remote version supports it
$follow = ''; $follow = '';
$follow_text = ''; $follow_text = '';
if (in_array($contact['rel'], [Model\Contact::FRIEND, Model\Contact::SHARING])) { if ($contact['uid'] && in_array($contact['rel'], [Model\Contact::FRIEND, Model\Contact::SHARING])) {
if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) { if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
$follow = $a->getBaseURL(true) . '/unfollow?url=' . urlencode($contact['url']); $follow = $a->getBaseURL(true) . '/unfollow?url=' . urlencode($contact['url']);
$follow_text = L10n::t('Disconnect/Unfollow'); $follow_text = L10n::t('Disconnect/Unfollow');
} }
} else { } elseif(!$contact['pending']) {
$follow = $a->getBaseURL(true) . '/follow?url=' . urlencode($contact['url']); $follow = $a->getBaseURL(true) . '/follow?url=' . urlencode($contact['url']);
$follow_text = L10n::t('Connect/Follow'); $follow_text = L10n::t('Connect/Follow');
} }