Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- `.env.production.sample`:
  Upstream deleted it, I decided to keep it.
- `package.json`:
  Upstream updated a dependency textually too close to wavesurfer.js
  which has been deleted from upstream but is kept in glitch-soc for now.
This commit is contained in:
Thibaut Girka
2020-06-30 23:00:20 +02:00
83 changed files with 2766 additions and 987 deletions

View File

@@ -12,6 +12,8 @@ class MoveWorker
else
queue_follow_unfollows!
end
copy_account_notes!
rescue ActiveRecord::RecordNotFound
true
end
@@ -34,4 +36,19 @@ class MoveWorker
UnfollowFollowWorker.push_bulk(accounts.map(&:id)) { |follower_id| [follower_id, @source_account.id, @target_account.id, bypass_locked] }
end
end
def copy_account_notes!
AccountNote.where(target_account: @source_account).find_each do |note|
text = I18n.with_locale(note.account.user.locale || I18n.default_locale) do
I18n.t('move_handler.copy_account_note_text', acct: @source_account.acct)
end
new_note = AccountNote.find_by(account: note.account, target_account: @target_account)
if new_note.nil?
AccountNote.create!(account: note.account, target_account: @target_account, comment: [text, note.comment].join('\n'))
else
new_note.update!(comment: [text, note.comment, '\n', new_note.comment].join('\n'))
end
end
end
end

View File

@@ -32,7 +32,7 @@ class PostProcessMediaWorker
media_attachment.file.reprocess!(:original)
media_attachment.processing = :complete
media_attachment.file_meta = previous_meta
media_attachment.file_meta = previous_meta.merge(media_attachment.file_meta).with_indifferent_access.slice(:focus, :original, :small)
media_attachment.save
rescue ActiveRecord::RecordNotFound
true

View File

@@ -11,7 +11,8 @@ class RedownloadMediaWorker
return if media_attachment.remote_url.blank?
media_attachment.file_remote_url = media_attachment.remote_url
media_attachment.download_file!
media_attachment.download_thumbnail!
media_attachment.save
rescue ActiveRecord::RecordNotFound
true