Fix remove group status
This commit is contained in:
parent
c1b9b8dbc5
commit
020074c188
2 changed files with 11 additions and 10 deletions
|
@ -76,7 +76,7 @@ class BatchedRemoveStatusService < BaseService
|
||||||
def unpush_from_group_timelines(status)
|
def unpush_from_group_timelines(status)
|
||||||
return unless status.account.group?
|
return unless status.account.group?
|
||||||
|
|
||||||
payload = Oj.dump(event: :delete, payload: status.reblog.id.to_s)
|
payload = Oj.dump(event: :delete, payload: status.reblog? ? status.reblog.id.to_s : status.id.to_s)
|
||||||
|
|
||||||
redis.publish("timeline:group:#{status.account.id}", payload)
|
redis.publish("timeline:group:#{status.account.id}", payload)
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,10 @@ class RemoveStatusService < BaseService
|
||||||
# @option [Boolean] :immediate
|
# @option [Boolean] :immediate
|
||||||
# @option [Boolean] :original_removed
|
# @option [Boolean] :original_removed
|
||||||
def call(status, **options)
|
def call(status, **options)
|
||||||
@payload = Oj.dump(event: :delete, payload: status.id.to_s)
|
@payload = Oj.dump(event: :delete, payload: status.id.to_s)
|
||||||
@reblog_payload = Oj.dump(event: :delete, payload: status.reblog.id.to_s) if status.reblog
|
@status = status
|
||||||
@status = status
|
@account = status.account
|
||||||
@account = status.account
|
@options = options
|
||||||
@options = options
|
|
||||||
|
|
||||||
@status.discard
|
@status.discard
|
||||||
|
|
||||||
|
@ -122,17 +121,19 @@ class RemoveStatusService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_from_group
|
def remove_from_group
|
||||||
redis.publish("timeline:group:#{@status.account.id}", @reblog_payload)
|
payload = @status.reblog? ? Oj.dump(event: :delete, payload: @status.reblog.id.to_s) : @payload
|
||||||
|
|
||||||
|
redis.publish("timeline:group:#{@status.account.id}", payload)
|
||||||
|
|
||||||
@status.tags.map(&:name).each do |hashtag|
|
@status.tags.map(&:name).each do |hashtag|
|
||||||
redis.publish("timeline:group:#{@status.account.id}:#{hashtag.mb_chars.downcase}", @reblog_payload)
|
redis.publish("timeline:group:#{@status.account.id}:#{hashtag.mb_chars.downcase}", payload)
|
||||||
end
|
end
|
||||||
|
|
||||||
if @status.media_attachments.any?
|
if @status.media_attachments.any?
|
||||||
redis.publish("timeline:group:media:#{@status.account.id}", @reblog_payload)
|
redis.publish("timeline:group:media:#{@status.account.id}", payload)
|
||||||
|
|
||||||
@status.tags.map(&:name).each do |hashtag|
|
@status.tags.map(&:name).each do |hashtag|
|
||||||
redis.publish("timeline:group:media:#{@status.account.id}:#{hashtag.mb_chars.downcase}", @reblog_payload)
|
redis.publish("timeline:group:media:#{@status.account.id}:#{hashtag.mb_chars.downcase}", payload)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue