mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 02:53:08 +02:00
fix: get account statuses for local users
This commit is contained in:
parent
97749e6722
commit
3526880607
3 changed files with 7 additions and 4 deletions
|
@ -107,6 +107,7 @@ export class ApiAccountMastodon {
|
||||||
const data = await this.client.getAccountStatuses(
|
const data = await this.client.getAccountStatuses(
|
||||||
convertId((this.request.params as any).id, IdType.SharkeyId),
|
convertId((this.request.params as any).id, IdType.SharkeyId),
|
||||||
convertTimelinesArgsId(argsToBools(limitToInt(this.request.query as any))),
|
convertTimelinesArgsId(argsToBools(limitToInt(this.request.query as any))),
|
||||||
|
this.BASE_URL,
|
||||||
);
|
);
|
||||||
return data.data.map((status) => convertStatus(status));
|
return data.data.map((status) => convertStatus(status));
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
|
|
@ -182,7 +182,8 @@ export interface MegalodonInterface {
|
||||||
exclude_replies?: boolean
|
exclude_replies?: boolean
|
||||||
exclude_reblogs?: boolean
|
exclude_reblogs?: boolean
|
||||||
only_media?: boolean
|
only_media?: boolean
|
||||||
}
|
},
|
||||||
|
host?: string
|
||||||
): Promise<Response<Array<Entity.Status>>>
|
): Promise<Response<Array<Entity.Status>>>
|
||||||
/**
|
/**
|
||||||
* Favourites timeline of any user.
|
* Favourites timeline of any user.
|
||||||
|
|
|
@ -291,7 +291,8 @@ export default class Misskey implements MegalodonInterface {
|
||||||
exclude_replies: boolean
|
exclude_replies: boolean
|
||||||
exclude_reblogs: boolean
|
exclude_reblogs: boolean
|
||||||
only_media?: boolean
|
only_media?: boolean
|
||||||
}
|
},
|
||||||
|
host?: string
|
||||||
): Promise<Response<Array<Entity.Status>>> {
|
): Promise<Response<Array<Entity.Status>>> {
|
||||||
if (options && options.pinned) {
|
if (options && options.pinned) {
|
||||||
return this.client
|
return this.client
|
||||||
|
@ -300,7 +301,7 @@ export default class Misskey implements MegalodonInterface {
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.data.pinnedNotes) {
|
if (res.data.pinnedNotes) {
|
||||||
return { ...res, data: res.data.pinnedNotes.map(n => MisskeyAPI.Converter.note(n)) }
|
return { ...res, data: res.data.pinnedNotes.map(n => MisskeyAPI.Converter.note(n, host)) }
|
||||||
}
|
}
|
||||||
return { ...res, data: [] }
|
return { ...res, data: [] }
|
||||||
})
|
})
|
||||||
|
@ -342,7 +343,7 @@ export default class Misskey implements MegalodonInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.client.post<Array<MisskeyAPI.Entity.Note>>('/api/users/notes', params).then(res => {
|
return this.client.post<Array<MisskeyAPI.Entity.Note>>('/api/users/notes', params).then(res => {
|
||||||
const statuses: Array<Entity.Status> = res.data.map(note => MisskeyAPI.Converter.note(note))
|
const statuses: Array<Entity.Status> = res.data.map(note => MisskeyAPI.Converter.note(note, host))
|
||||||
return Object.assign(res, {
|
return Object.assign(res, {
|
||||||
data: statuses
|
data: statuses
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue