self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
- if (empty($this->parameters['id'])) {
- DI::mstdnError()->UnprocessableEntity();
- }
-
- $id = $this->parameters['id'];
- if (!DBA::exists('contact', ['id' => $id, 'uid' => 0])) {
- DI::mstdnError()->RecordNotFound();
- }
-
$request = $this->getRequest([
'max_id' => 0, // Return results older than this id
'since_id' => 0, // Return results newer than this id
$params = ['order' => ['cid' => true], 'limit' => $request['limit']];
- $condition = ['cid' => $id, 'blocked' => true, 'uid' => $uid];
+ $condition = ['blocked' => true, 'uid' => $uid];
if (!empty($request['max_id'])) {
$condition = DBA::mergeConditions($condition, ["`cid` < ?", $request['max_id']]);
}
$followers = DBA::select('user-contact', ['cid'], $condition, $params);
+ $accounts = [];
while ($follower = DBA::fetch($followers)) {
self::setBoundaries($follower['cid']);
$accounts[] = DI::mstdnAccount()->createFromContactId($follower['cid'], $uid);