]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Thu, 29 Aug 2019 10:07:50 +0000 (12:07 +0200)
committerThibaut Girka <thib@sitedethib.com>
Thu, 29 Aug 2019 10:07:50 +0000 (12:07 +0200)
Conflicts:
- app/models/status.rb
- app/services/remove_status_service.rb
- db/schema.rb

All conflicts were due to the addition of a `deleted_at` attribute
to Statuses and reworked database indexes.

16 files changed:
1  2 
Gemfile
Gemfile.lock
app/controllers/api/v1/statuses_controller.rb
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/styles/mastodon/components.scss
app/models/status.rb
app/services/batched_remove_status_service.rb
app/services/remove_status_service.rb
app/views/admin/dashboard/index.html.haml
app/views/statuses/_simple_status.html.haml
config/locales/en.yml
config/locales/simple_form.en.yml
db/schema.rb
package.json
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index de790027d5b766a1bf1824213f552ad765d2f06c,9cfaddcecb28c15ac5ddeee472431f4045b4b5b9..757deea06e35635f322328a2f0748be8616728c3
  #  account_id             :bigint(8)        not null
  #  application_id         :bigint(8)
  #  in_reply_to_account_id :bigint(8)
 +#  local_only             :boolean
 +#  full_status_text       :text             default(""), not null
  #  poll_id                :bigint(8)
 +#  content_type           :string
+ #  deleted_at             :datetime
  #
  
  class Status < ApplicationRecord
index c19fa2126fbcb12baf5fe0e4c69c083305572064,685c1d4bffe92baa409c0cf92141b0d90ba2023b..b2f7120893a4b5f5cca6f9888200c62baaf27d49
@@@ -23,8 -28,8 +28,9 @@@ class RemoveStatusService < BaseServic
          remove_from_hashtags
          remove_from_public
          remove_from_media if status.media_attachments.any?
 +        remove_from_direct if status.direct_visibility?
          remove_from_spam_check
+         remove_media
  
          @status.destroy!
        else
      redis.publish('timeline:public:local:media', @payload) if @status.local?
    end
  
 +  def remove_from_direct
 +    @mentions.each do |mention|
 +      FeedManager.instance.unpush_from_direct(mention.account, @status) if mention.account.local?
 +    end
 +  end
 +
+   def remove_media
+     return if @options[:redraft]
+     @status.media_attachments.destroy_all
+   end
    def remove_from_spam_check
      redis.zremrangebyscore("spam_check:#{@status.account_id}", @status.id, @status.id)
    end
Simple merge
Simple merge
diff --cc db/schema.rb
index 7e62fe1f56e92ecbfdf2260e0db34befc3974af5,482bca367a462a77789e5cab5d1c95f3eddd9a7c..328506b50283d1cc36f3a894162e9c4d767dd85a
@@@ -654,10 -643,10 +654,12 @@@ ActiveRecord::Schema.define(version: 20
      t.bigint "account_id", null: false
      t.bigint "application_id"
      t.bigint "in_reply_to_account_id"
 +    t.boolean "local_only"
      t.bigint "poll_id"
-     t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc }
 +    t.string "content_type"
+     t.datetime "deleted_at"
+     t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20190820", order: { id: :desc }, where: "(deleted_at IS NULL)"
+     t.index ["id", "account_id"], name: "index_statuses_local_20190824", order: { id: :desc }, where: "((local OR (uri IS NULL)) AND (deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))"
      t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id"
      t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id"
      t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id"
diff --cc package.json
Simple merge
diff --cc yarn.lock
Simple merge