fix: get account statuses for local users

This commit is contained in:
Mar0xy 2023-09-25 03:23:03 +02:00
parent 97749e6722
commit 3526880607
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
3 changed files with 7 additions and 4 deletions

View file

@ -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) {

View file

@ -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.

View file

@ -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
}) })