]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Sat, 16 Mar 2019 19:59:33 +0000 (20:59 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sat, 16 Mar 2019 19:59:33 +0000 (20:59 +0100)
Conflicts:
- app/services/remove_status_service.rb
  Conflict because we still handle the direct timeline.
  Took upstream changes, with that one extra function call.
- config/locales/ca.yml
  Conflict because theme names were updated.
  Decided to *keep* the theme names even if they are useless
  to avoid future conflicts.
- config/locales/oc.yml
  Decided to *keep* the theme names even if they are useless
  to avoid future conflicts.
- config/locales/pl.yml
  Decided to *keep* the theme names even if they are useless
  to avoid future conflicts.

12 files changed:
1  2 
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/mastodon/locales/ja.json
app/javascript/mastodon/locales/pl.json
app/javascript/styles/mastodon/components.scss
app/services/remove_status_service.rb
config/locales/es.yml
config/locales/ja.yml
config/locales/pl.yml
config/locales/simple_form.pl.yml
package.json
yarn.lock

index 7eec11ddfe30e0edb2ee1f992f1568585dee1bc8,747f209f3320b8f9b54304fddc30725bc0f5f098..6e4998e07e2be53e6e3689720502103cd4f2d9ae
@@@ -14,17 -14,22 +14,23 @@@ class RemoveStatusService < BaseServic
      @stream_entry = status.stream_entry
      @options      = options
  
-     remove_from_self if status.account.local?
-     remove_from_followers
-     remove_from_lists
-     remove_from_affected
-     remove_reblogs
-     remove_from_hashtags
-     remove_from_public
-     remove_from_media if status.media_attachments.any?
-     remove_from_direct if status.direct_visibility?
-     @status.destroy!
+     RedisLock.acquire(lock_options) do |lock|
+       if lock.acquired?
+         remove_from_self if status.account.local?
+         remove_from_followers
+         remove_from_lists
+         remove_from_affected
+         remove_reblogs
+         remove_from_hashtags
+         remove_from_public
+         remove_from_media if status.media_attachments.any?
++        remove_from_direct if status.direct_visibility?
+         @status.destroy!
+       else
+         raise Mastodon::RaceConditionError
+       end
+     end
  
      # There is no reason to send out Undo activities when the
      # cause is that the original object has been removed, since
      redis.publish('timeline:public:local:media', @payload) if @status.local?
    end
  
 +  def remove_from_direct
 +    @mentions.each do |mention|
 +      Redis.current.publish("timeline:direct:#{mention.account.id}", @payload) if mention.account.local?
 +    end
 +    Redis.current.publish("timeline:direct:#{@account.id}", @payload) if @account.local?
 +  end
++
+   def lock_options
+     { redis: Redis.current, key: "distribute:#{@status.id}" }
+   end
  end
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc package.json
Simple merge
diff --cc yarn.lock
Simple merge