Add resolve argument for search account

This commit is contained in:
AkiraFukushima 2020-03-14 16:54:49 +09:00
parent 3f5cb4d025
commit 32e6f16e0e
3 changed files with 22 additions and 4 deletions

View file

@ -473,12 +473,23 @@ export default class Mastodon implements MegalodonInterface {
public async searchAccount(
q: string,
following: boolean,
following?: boolean | null,
resolve?: boolean | null,
limit?: number | null,
max_id?: string | null,
since_id?: string | null
): Promise<Response<Array<Entity.Account>>> {
let params = { q: q, following: following }
let params = { q: q }
if (following !== undefined && following !== null) {
params = Object.assign(params, {
following: following
})
}
if (resolve !== undefined && resolve !== null) {
params = Object.assign(params, {
resolve: resolve
})
}
if (max_id) {
params = Object.assign(params, {
max_id: max_id

View file

@ -316,7 +316,8 @@ export interface MegalodonInterface {
*/
searchAccount(
q: string,
following: boolean,
following?: boolean | null,
resolve?: boolean | null,
limit?: number | null,
max_id?: string | null,
since_id?: string | null

View file

@ -527,7 +527,8 @@ export default class Misskey implements MegalodonInterface {
*/
public async searchAccount(
q: string,
_following: boolean,
_following?: boolean | null,
resolve?: boolean | null,
limit?: number | null,
_max_id?: string | null,
_since_id?: string | null
@ -536,6 +537,11 @@ export default class Misskey implements MegalodonInterface {
query: q,
detail: true
}
if (resolve !== undefined && resolve !== null) {
params = Object.assign(params, {
localOnly: resolve
})
}
if (limit) {
params = Object.assign(params, {
limit: limit