glacasa / Mastonet

C# Library for Mastodon
MIT License
225 stars 36 forks source link

Added method to get accounts as an admin #96

Closed mancku closed 1 year ago

mancku commented 1 year ago

This PR contains the new entity and the new partial class needed to get the accounts as an admin.

glacasa commented 1 year ago

Thanks for the PR ! sorry for the delay, I think I just missed the notif e-mail. I'm going to look at that

mancku commented 1 year ago

Thanks @glacasa! Let me know if you need me to clarify or modify something

glacasa commented 1 year ago

I updated the code to match with the Mastodon docs (mostly nullable properties) https://github.com/glacasa/Mastonet/commit/c597878e8deb78603ef9d614750fc5e99ff60fca

I don't have an admin mastodon account to test, could you check if I didn't break anything ?

It's on Nuget if you want to try https://www.nuget.org/packages/Mastonet/2.2.2-preview-adminapi

(side note : are from Catalunya ? I'm in Ariège, just on the other side of the french border 👋)

ctrl-alt-d commented 1 year ago

Hi @glacasa, Comment ça va? I just tested this branch against our Mastodon node, using admin token credentials, and it runs like a charm. I tested from both, source code and package. Deserialization also pagination are all right.

(side note : yes, we are from Catalunya. Best regards from this side of the border 👋)

mancku commented 1 year ago

@glacasa hi from the other side of the Pyrenees 😃

While coding this PR I saw that some parts of the project could be refactored to re-use code. Would you be OK with me doing a refactor and submitting it as a PR?

glacasa commented 1 year ago

Totally ok to have better code 👍 What parts exactly would you refactor ?

mancku commented 1 year ago

Some things that came to my mind while adding the Admin classes: