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

Updated Account to latest fields, supporting more account preferences, updated Post edit to include languge #270

Merged
merged 18 commits into from Apr 2, 2024

Conversation

technicat
Copy link
Contributor

Added noindex, indexable, hideCollections, and role to Account, which supports opting in/out of search and hiding follower/followee info from the public, and updated/added TootSource and TootRole accordingly (see added test cases for reference)

Also fixed missing snake case mapping in PostEditParams which was losing spoilers and attachments.

@technicat
Copy link
Contributor Author

fixes #268

@kkostov
Copy link
Contributor

kkostov commented Mar 31, 2024

@technicat That's quite the change! Thank you so much 🙌

indexable, noindex and hideCollections looks good.

EditPostParams looks good.

TootSource looks good.

UpdateCredentialsParams looks good.

✅ 🎉 Unit Tests ❤️

Regarding the role field, I think we need a little bit more to support it. Can we take it out of this PR?

Some thoughts: Pleroma uses "roles" as an object with a boolean field for "admin" or "moderator" which we can handle during serialization. I like the TootRole concept, perhaps we could simplify this object a bit to allow us to fill-in values when coming from other flavours (e.g. remove the id field, and change color, permissions and highlighted to Optional) Also, Mastodon only returns a role for "CredentialAccount", not regular "Account" so we should consider creating a dedicated model for the endpoints which actually return a role field.

@kkostov
Copy link
Contributor

kkostov commented Mar 31, 2024

@technicat On second thought, I'm OK to merge this if we can simplify TootRole so tweaking the serialization for pleroma will not cause too much breakage.

@kkostov
Copy link
Contributor

kkostov commented Mar 31, 2024

@technicat On second, second thought 😅, it seems supporting the Admin API calls for Pleroma/Akkoma's roles will be very much a dedicated effort as they require an entirely specific set of endpoints and models. Let's go with the Mastodon's role for now.

@kkostov kkostov merged commit ec6b311 into TootSDK:main Apr 2, 2024
6 checks passed
@technicat technicat deleted the field-updates branch April 2, 2024 16:45
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 this pull request may close these issues.

None yet

3 participants