Merge pull request #257 from h3poteto/add/following

Add following and resolve argument for search account
This commit is contained in:
AkiraFukushima 2020-03-14 17:05:21 +09:00 committed by GitHub
commit dc3958c3bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -473,11 +473,23 @@ export default class Mastodon implements MegalodonInterface {
public async searchAccount(
q: string,
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 }
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,6 +316,8 @@ export interface MegalodonInterface {
*/
searchAccount(
q: string,
following?: boolean | null,
resolve?: boolean | null,
limit?: number | null,
max_id?: string | null,
since_id?: string | null

View file

@ -527,12 +527,20 @@ export default class Misskey implements MegalodonInterface {
*/
public async searchAccount(
q: string,
_following?: boolean | null,
resolve?: boolean | null,
limit?: number | null,
_max_id?: string | null,
_since_id?: string | null
): Promise<Response<Array<Entity.Account>>> {
let params = {
query: q
query: q,
detail: true
}
if (resolve !== undefined && resolve !== null) {
params = Object.assign(params, {
localOnly: resolve
})
}
if (limit) {
params = Object.assign(params, {