Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add another option to GoToSocial API #2211

Merged
merged 2 commits into from
Sep 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions megalodon/src/gotosocial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ export default class Gotosocial implements MegalodonInterface {
* @param options.exclude_replies Return statuses which exclude replies.
* @param options.exclude_reblogs Return statuses which exclude reblogs.
* @param options.only_media Show only statuses with media attached? Defaults to false.
* @param options.only_public Return statuses with public visibility only.
* @return Account's statuses.
*/
public async getAccountStatuses(
Expand All @@ -369,6 +370,7 @@ export default class Gotosocial implements MegalodonInterface {
exclude_replies?: boolean
exclude_reblogs?: boolean
only_media: boolean
only_public?: boolean
Ryuno-Ki marked this conversation as resolved.
Show resolved Hide resolved
}
): Promise<Response<Array<Entity.Status>>> {
let params = {}
Expand Down Expand Up @@ -413,6 +415,11 @@ export default class Gotosocial implements MegalodonInterface {
only_media: options.only_media
})
}
if (options.only_public) {
params = Object.assign(params, {
only_public: options.only_public
})
}
}
return this.client.get<Array<GotosocialAPI.Entity.Status>>(`/api/v1/accounts/${id}/statuses`, params).then(res => {
return Object.assign(res, {
Expand Down
Loading