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

Option to GET only public account statuses (GoToSocial) #2210

Closed
Ryuno-Ki opened this issue Sep 19, 2024 · 4 comments · Fixed by #2211
Closed

Option to GET only public account statuses (GoToSocial) #2210

Ryuno-Ki opened this issue Sep 19, 2024 · 4 comments · Fixed by #2211

Comments

@Ryuno-Ki
Copy link
Contributor

Amazing project! I love it! My use case is to display my last public toot (not a reply or boost) on my homepage.

I'm almost there! Running my own GoToSocial instance at fedi.jaenis.ch I can study the API:
https://docs.gotosocial.org/en/latest/api/swagger/

I can see that there's an only_public flag that I cannot set in Megalodon's implementation.

For now I'm overfetching and filtering the results (status.visibility === "public") on the client. This incurs a little bit more data, which I would like to avoid (because it could mean visitors paying more than strictly necessary).

Is there a way to extend the API here? Or are there constraints (such as: same API for all fedi services)?

@h3poteto
Copy link
Owner

For example, Mastodon doesn't have such parameter: https://github.com/mastodon/mastodon/blob/8afa3bb2fa872c2413cd264ca3321a7509a5ffdf/app/lib/account_statuses_filter.rb#L3

But, it seems like Gotosocial has it. So, it's not so difficult to implement the parameter in megalodon.

@Ryuno-Ki
Copy link
Contributor Author

Are you accepting PRs on it? I could take an attempt then.

@h3poteto
Copy link
Owner

Of course, I'm waiting for your PRs. Thank you.

@Ryuno-Ki
Copy link
Contributor Author

I've opened #2211 with the change.

Looking at the tests folder I could not see a folder or file for GoToSocial. Therefore no updates there.
I tested the changes by changing the files in the node_modules of an existing application and confirmed they're working (better than blindly accepting it, I feel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants