diff --git a/src/Model/Group.php b/src/Model/Group.php index da77335f12..fa41d26467 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -358,14 +358,18 @@ class Group throw new HTTPException\NotFoundException('Group not found.'); } + $contactIds = []; + foreach ($contacts as $cid) { $cdata = Contact::getPublicAndUserContactID($cid, $group['uid']); if (empty($cdata['user'])) { throw new HTTPException\NotFoundException('Invalid contact.'); } - DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $cdata['user']]); + $contactIds[] = $cdata['user']; } + + DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $contactIds]); } /** diff --git a/src/Module/Api/Mastodon/Lists/Accounts.php b/src/Module/Api/Mastodon/Lists/Accounts.php index 8d27207fc4..413cacae29 100644 --- a/src/Module/Api/Mastodon/Lists/Accounts.php +++ b/src/Module/Api/Mastodon/Lists/Accounts.php @@ -45,6 +45,7 @@ class Accounts extends BaseApi if (empty($request['account_ids']) || empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } + return Group::removeMembers($this->parameters['id'], $request['account_ids']); } @@ -59,6 +60,7 @@ class Accounts extends BaseApi if (empty($request['account_ids']) || empty($this->parameters['id'])) { DI::mstdnError()->UnprocessableEntity(); } + return Group::addMembers($this->parameters['id'], $request['account_ids']); }