From b214470b1a0e17750b8652200828d29eeedf6a51 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 9 Oct 2021 02:10:16 -0400 Subject: [PATCH] Replace remaining explicit network value checks by Protocol::supportsFollow calls --- mod/unfollow.php | 2 +- src/Content/Widget/VCard.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/unfollow.php b/mod/unfollow.php index d566ac3cf4..ac8ed40c31 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -67,7 +67,7 @@ function unfollow_content(App $a) // NOTREACHED } - if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) { + if (!Protocol::supportsFollow($contact['network'])) { notice(DI::l10n()->t('Unfollowing is currently not supported by your network.')); DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']); // NOTREACHED diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index d66b60513e..38b75272f5 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -75,7 +75,7 @@ class VCard $pending = $pcontact['pending'] ?? false; } - if (!$contact['self'] && in_array($contact['network'], Protocol::NATIVE_SUPPORT)) { + if (!$contact['self'] && Protocol::supportsFollow($contact['network'])) { if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) { $unfollow_link = 'unfollow?url=' . urlencode($contact['url']) . '&auto=1'; } elseif (!$pending) {