X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Funfollow.php;h=0aa8a87b50865d3bc9715fe6d1d334d32a3f3704;hb=0ad9d300ac2070bc535660878089e027cdd07291;hp=a307c4d6e683594d3fd61ec4a97502816276bd1a;hpb=8dc4499bcfe0adef3a3a4ff77abfe0c5588a3409;p=friendica.git diff --git a/mod/unfollow.php b/mod/unfollow.php index a307c4d6e6..0aa8a87b50 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -1,6 +1,6 @@ t('Unfollowing is currently not supported by your network.')); DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']); // NOTREACHED @@ -122,7 +122,7 @@ function unfollow_process(string $url) $owner = User::getOwnerDataById($uid); if (!$owner) { - \Friendica\Module\Security\Logout::init(); + (new \Friendica\Module\Security\Logout())->init(); // NOTREACHED } @@ -137,27 +137,18 @@ function unfollow_process(string $url) // NOTREACHED } - $dissolve = ($contact['rel'] == Contact::SHARING); - - $notice_message = ''; $return_path = $base_return_path . '/' . $contact['id']; try { - $result = Contact::terminateFriendship($owner, $contact, $dissolve); - - if ($result === null) { - $notice_message = DI::l10n()->t('Unfollowing is currently not supported by this contact\'s network.'); - } + $result = Contact::terminateFriendship($owner, $contact); if ($result === false) { $notice_message = DI::l10n()->t('Unable to unfollow this contact, please retry in a few minutes or contact your administrator.'); - } - - if ($result === true) { + } else { $notice_message = DI::l10n()->t('Contact was successfully unfollowed'); } } catch (Exception $e) { - DI::logger()->error($e->getMessage(), ['owner' => $owner, 'contact' => $contact, 'dissolve' => $dissolve]); + DI::logger()->error($e->getMessage(), ['owner' => $owner, 'contact' => $contact]); $notice_message = DI::l10n()->t('Unable to unfollow this contact, please contact your administrator'); }