Move unfollow protocol to worker task
- Add uid parameter to unfollow hook - Rework and unify Contact::unfollow, Contact::removeSharer and Contact::terminateFriendship - Add missing twitterUser property to Twitter\Friendships\Destroy module
This commit is contained in:
@@ -59,8 +59,7 @@ class Block extends BaseApi
|
||||
Contact\User::setBlocked($cdata['user'], $uid, true);
|
||||
|
||||
// Mastodon-expected behavior: relationship is severed on block
|
||||
Contact::terminateFriendship($owner, $contact);
|
||||
Contact::revokeFollow($contact);
|
||||
Contact::terminateFriendship($contact);
|
||||
|
||||
System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
|
||||
}
|
||||
|
||||
@@ -40,7 +40,14 @@ class Unfollow extends BaseApi
|
||||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
Contact::unfollow($this->parameters['id'], $uid);
|
||||
$cdata = Contact::getPublicAndUserContactID($this->parameters['id'], $uid);
|
||||
if (empty($cdata['user'])) {
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
|
||||
$contact = Contact::getById($cdata['user']);
|
||||
|
||||
Contact::unfollow($contact);
|
||||
|
||||
System::jsonExit(DI::mstdnRelationship()->createFromContactId($this->parameters['id'], $uid)->toArray());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user