mirror of
https://github.com/friendica/friendica
synced 2025-04-23 10:30:11 +00:00
Fix list of accounts
This commit is contained in:
parent
975c32116d
commit
4476634f6c
2 changed files with 22 additions and 6 deletions
|
@ -65,12 +65,18 @@ class Accounts extends BaseApi
|
|||
$max_id = (int)!isset($_REQUEST['max_id']) ? 0 : $_REQUEST['max_id'];
|
||||
// Return results newer than this id
|
||||
$since_id = (int)!isset($_REQUEST['since_id']) ? 0 : $_REQUEST['since_id'];
|
||||
// Maximum number of results to return. Defaults to 20.
|
||||
// Maximum number of results. Defaults to 40. Max 40.
|
||||
// Set to 0 in order to get all accounts without pagination.
|
||||
$limit = (int)!isset($_REQUEST['limit']) ? 40 : $_REQUEST['limit'];
|
||||
|
||||
|
||||
$params = ['order' => ['contact-id' => true], 'limit' => $limit];
|
||||
$params = ['order' => ['contact-id' => true]];
|
||||
|
||||
if ($limit != 0) {
|
||||
$params['limit'] = $limit;
|
||||
|
||||
}
|
||||
|
||||
$condition = ['gid' => $id];
|
||||
|
||||
if (!empty($max_id)) {
|
||||
|
@ -87,6 +93,8 @@ class Accounts extends BaseApi
|
|||
$params['order'] = ['contact-id'];
|
||||
}
|
||||
|
||||
$accounts = [];
|
||||
|
||||
$members = DBA::select('group_member', ['contact-id'], $condition, $params);
|
||||
while ($member = DBA::fetch($members)) {
|
||||
$accounts[] = DI::mstdnAccount()->createFromContactId($member['contact-id'], $uid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue