X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FContact.php;h=f051d870a295c8710a72f21a7b7c57992fc3f486;hb=49c47008d189617ec989b04c8ec42b3c1484e87f;hp=11f7f87ced01f35045b1803d7061d826e34981e8;hpb=322b7c856ca9ba53bd9c7da50dd5c1e3c9197d56;p=friendica.git diff --git a/src/Console/Contact.php b/src/Console/Contact.php index 11f7f87ced..f051d870a2 100644 --- a/src/Console/Contact.php +++ b/src/Console/Contact.php @@ -199,19 +199,18 @@ HELP; throw new RuntimeException('Contact not found'); } - $user = UserModel::getById($contact['uid']); + if (empty($contact['uid'])) { + throw new RuntimeException('Contact must be user-specific (uid != 0)'); + } try { - $result = ContactModel::terminateFriendship($user, $contact); - if ($result === false) { - throw new RuntimeException('Unable to unfollow this contact, please retry in a few minutes or check the logs.'); - } + ContactModel::unfollow($contact); $this->out('Contact was successfully unfollowed'); return true; } catch (\Exception $e) { - DI::logger()->error($e->getMessage(), ['owner' => $user, 'contact' => $contact]); + DI::logger()->error($e->getMessage(), ['contact' => $contact]); throw new RuntimeException('Unable to unfollow this contact, please check the log'); } }