Compare commits

...

7 Commits

Author SHA1 Message Date
613090d38a
Merge branch 'feature/mastodon_api' into live
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-17 18:57:10 +04:00
fb03427d59
Allow syncing a single Mastodon profile
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-17 18:56:34 +04:00
ad138f715c
Update doc 2025-05-17 18:56:34 +04:00
6730aae2dc
Only update other avatars in one place
Prevent future mistakes
2025-05-17 18:56:33 +04:00
a71aa3fda2
Don't queue job when service isn't enabled 2025-05-17 18:56:33 +04:00
92e6b1395a
Add avatar to admin user page 2025-05-17 18:56:33 +04:00
37c59b7b0c
Sync Mastodon IDs/profiles to local accounts
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)
2025-05-17 18:56:30 +04:00

View File

@ -24,7 +24,7 @@ module MastodonManager
mastodon_user = MastodonManager::FindUser.call username: user.cn
if mastodon_user
Rails.logger.debug { "Setting mastodon_id for user #{user.cn}" }
user.update! mastodon_id: @user[:id]
user.update! mastodon_id: mastodon_user.dig(:account, :id).to_i
else
Rails.logger.debug { "No Mastodon user found for username #{user.cn}" }
next