Add Mastodon API client, service for syncing avatars and display names #225

Merged
greg merged 13 commits from feature/mastodon_api into master 2025-05-23 08:48:16 +00:00
Owner

Refactors some of the avatar and user manager logic and services. Adds e.g. a service for importing remote avatars from any URL.

I successfully ran a sync in production with this, where it only updated avatars and names that weren't set yet.

We can now easily add any other Mastodon API functionality, like e.g. setting a user's contributor status/role on Mastodon (once we have that status in our user directory).

Edit: there's also this unrelated drive-by fix: a71aa3fda2
Edit 2: deleting a user name by submitting an empty input wasn't possible before, so I fixed that, too: 7b0ebb761f

Refactors some of the avatar and user manager logic and services. Adds e.g. a service for importing remote avatars from any URL. I successfully ran a sync in production with this, where it only updated avatars and names that weren't set yet. We can now easily add any other Mastodon API functionality, like e.g. setting a user's contributor status/role on Mastodon (once we have that status in our user directory). Edit: there's also this unrelated drive-by fix: a71aa3fda2a91a0add6e5700edfa7d69fe6bf73c Edit 2: deleting a user name by submitting an empty input wasn't possible before, so I fixed that, too: 7b0ebb761f44937c0ae7fa9d82735a9fce3e64f8
raucao added the
feature
label 2025-05-22 12:02:19 +00:00
raucao added 13 commits 2025-05-22 12:02:20 +00:00
Add a new REST API service class to keep things DRY
Add a new service to import some data from Mastodon accounts:

* Find users by username, store Mastodon account ID in local db when
  found
* Import display name (don't overwrite existing)
* Import avatar (don't overwrite existing)
Prevent future mistakes
Allow syncing a single Mastodon profile
All checks were successful
continuous-integration/drone/push Build is passing
fb03427d59
Allow display name to be removed
All checks were successful
continuous-integration/drone/push Build is passing
7b0ebb761f
When form field is empty
Merge branch 'master' into feature/mastodon_api
Some checks are pending
continuous-integration/drone/push Build is running
c374bcd3bc
Use production link
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 2s
3538067da6
raucao added the
kredits-2
integration
mastodon
labels 2025-05-22 12:07:04 +00:00
raucao requested review from greg 2025-05-22 12:07:42 +00:00
greg approved these changes 2025-05-23 08:47:19 +00:00
greg left a comment
Owner

Looks good to me! 👍

Looks good to me! 👍
greg merged commit 308cac5a39 into master 2025-05-23 08:48:16 +00:00
greg deleted branch feature/mastodon_api 2025-05-23 08:48:16 +00:00
Sign in to join this conversation.
No description provided.