+ $owner = User::getOwnerDataById($uid);
+ if (empty($owner)) {
+ DI::mstdnError()->Forbidden();
+ }
+
+ $cdata = Contact::getPublicAndUserContactID($parameters['id'], $uid);
+ if (empty($cdata['user'])) {
+ DI::mstdnError()->RecordNotFound();
+ }
+
+ $contact = Contact::getById($cdata['user']);
+ if (empty($contact)) {
+ DI::mstdnError()->RecordNotFound();
+ }
+
+ Contact\User::setBlocked($cdata['user'], $uid, true);
+
+ // Mastodon-expected behavior: relationship is severed on block
+ Contact::terminateFriendship($owner, $contact);
+ Contact::revokeFollow($contact);