1
0

fix: megalodon reblogged and favourited user info, add createdAt to note

This commit is contained in:
Mar0xy
2023-09-25 03:55:21 +02:00
parent 74213ba2b9
commit a7778e6425
5 changed files with 11 additions and 9 deletions
+4 -4
View File
@@ -1177,25 +1177,25 @@ export default class Misskey implements MegalodonInterface {
/**
* POST /api/notes/renotes
*/
public async getStatusRebloggedBy(id: string): Promise<Response<Array<Entity.Account>>> {
public async getStatusRebloggedBy(id: string, host?: string): Promise<Response<Array<Entity.Account>>> {
return this.client
.post<Array<MisskeyAPI.Entity.Note>>('/api/notes/renotes', {
noteId: id
})
.then(res => ({
...res,
data: res.data.map(n => MisskeyAPI.Converter.user(n.user))
data: res.data.map(n => MisskeyAPI.Converter.user(n.user, host))
}))
}
public async getStatusFavouritedBy(_id: string): Promise<Response<Array<Entity.Account>>> {
public async getStatusFavouritedBy(_id: string, host?: string): Promise<Response<Array<Entity.Account>>> {
return this.client.post<Array<MisskeyAPI.Entity.Reaction>>("/api/notes/reactions", {
noteId: _id,
})
.then(async (res) => ({
...res,
data: (
await Promise.all(res.data.map((n) => this.getAccount(n.user.id)))
await Promise.all(res.data.map((n) => this.getAccount(n.user.id, host)))
).map((p) => p.data),
}));
}