6 Commits

Author SHA1 Message Date
1dcdc2b032 Allow syncing a single Mastodon profile
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-17 18:22:11 +04:00
bfa1514181 Update doc
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-17 18:11:17 +04:00
f0846308da Only update other avatars in one place
All checks were successful
continuous-integration/drone/push Build is passing
Prevent future mistakes
2025-05-17 18:02:13 +04:00
b3b7fe6359 Don't queue job when service isn't enabled 2025-05-17 18:02:13 +04:00
f0b541ee50 Add avatar to admin user page 2025-05-17 18:02:13 +04:00
df9077e3c1 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:02:07 +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: mastodon_user.dig(:account, :id).to_i
user.update! mastodon_id: @user[:id]
else
Rails.logger.debug { "No Mastodon user found for username #{user.cn}" }
next