mirror of
https://github.com/mastodon/mastodon.git
synced 2025-03-13 14:08:34 +01:00
Add moved note for newly followed via migration
This commit is contained in:
parent
ed99923138
commit
0bf50cbbbe
2 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,7 @@ class MoveWorker
|
|||
copy_account_notes!
|
||||
carry_blocks_over!
|
||||
carry_mutes_over!
|
||||
carry_follows_over!
|
||||
|
||||
raise @deferred_error unless @deferred_error.nil?
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
@ -122,6 +123,14 @@ class MoveWorker
|
|||
end
|
||||
end
|
||||
|
||||
def carry_follows_over!
|
||||
@source_account.followers.local.find_each do |follower|
|
||||
add_account_note_if_needed!(follower.account, 'move_handler.carry_follows_over_text')
|
||||
rescue => e
|
||||
@deferred_error = e
|
||||
end
|
||||
end
|
||||
|
||||
def add_account_note_if_needed!(account, id)
|
||||
unless AccountNote.exists?(account: account, target_account: @target_account)
|
||||
text = I18n.with_locale(account.user&.locale.presence || I18n.default_locale) do
|
||||
|
|
|
@ -1459,6 +1459,7 @@ en:
|
|||
move_handler:
|
||||
carry_blocks_over_text: This user moved from %{acct}, which you had blocked.
|
||||
carry_mutes_over_text: This user moved from %{acct}, which you had muted.
|
||||
carry_follows_over_text: This user moved from %{acct}, which you had followed.
|
||||
copy_account_note_text: 'This user moved from %{acct}, here were your previous notes about them:'
|
||||
navigation:
|
||||
toggle_menu: Toggle menu
|
||||
|
|
Loading…
Add table
Reference in a new issue