From: Thibaut Girka Date: Wed, 13 May 2020 20:11:49 +0000 (+0200) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=3baacf6993581ba91e3e3ae0071b25a645d71115;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream --- 3baacf6993581ba91e3e3ae0071b25a645d71115 diff --cc app/services/fan_out_on_write_service.rb index 72f716dc5,276eac0c1..dd9c1264d --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@@ -93,17 -92,13 +97,21 @@@ class FanOutOnWriteService < BaseServic Rails.logger.debug "Delivering status #{status.id} to media timeline" Redis.current.publish('timeline:public:media', @payload) - Redis.current.publish('timeline:public:local:media', @payload) if status.local? + if status.local? + Redis.current.publish('timeline:public:local:media', @payload) + else + Redis.current.publish('timeline:public:remote:media', @payload) + end end + def deliver_to_direct_timelines(status) + Rails.logger.debug "Delivering status #{status.id} to direct timelines" + + FeedInsertWorker.push_bulk(status.mentions.includes(:account).map(&:account).select { |mentioned_account| mentioned_account.local? }) do |account| + [status.id, account.id, :direct] + end + end + def deliver_to_own_conversation(status) AccountConversation.add_status(status.account, status) end diff --cc app/services/remove_status_service.rb index 1ddce675c,4f0edc3cf..a5aafee21 --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@@ -149,15 -151,13 +153,19 @@@ class RemoveStatusService < BaseServic return unless @status.public_visibility? redis.publish('timeline:public:media', @payload) - redis.publish('timeline:public:local:media', @payload) if @status.local? + if @status.local? + redis.publish('timeline:public:local:media', @payload) + else + redis.publish('timeline:public:remote:media', @payload) + end 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] || (!@options[:immediate] && @status.reported?) diff --cc package.json index 2d454f825,44f810b98..5357f4657 --- a/package.json +++ b/package.json @@@ -68,12 -67,11 +68,12 @@@ "@babel/preset-env": "^7.9.6", "@babel/preset-react": "^7.9.4", "@babel/runtime": "^7.8.4", - "@clusterws/cws": "^0.17.3", + "@clusterws/cws": "^2.0.0", "@gamestdio/websocket": "^0.3.2", - "@rails/ujs": "^6.0.2", + "@rails/ujs": "^6.0.3", "array-includes": "^3.1.1", "arrow-key-navigation": "^1.1.0", + "atrament": "0.2.4", "autoprefixer": "^9.7.6", "axios": "^0.19.2", "babel-loader": "^8.1.0",