Skip to content

Commit

Permalink
Fix bubble timeline websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEssem committed Dec 1, 2024
1 parent ef55331 commit 7ec4992
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ def local?
attributes['local'] || uri.nil?
end

def bubble?
BubbleDomain.in_bubble?(account.domain)
end

def in_reply_to_local_account?
reply? && thread&.account&.local?
end
Expand Down
2 changes: 2 additions & 0 deletions app/services/batched_remove_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ def unpush_from_public_timelines(status, pipeline)

pipeline.publish('timeline:public', payload)
pipeline.publish(status.local? ? 'timeline:public:local' : 'timeline:public:remote', payload)
pipeline.publish('timeline:public:bubble', payload) if status.bubble?

if status.media_attachments.any?
pipeline.publish('timeline:public:media', payload)
pipeline.publish(status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', payload)
pipeline.publish('timeline:public:bubble:media', payload) if status.bubble?
end

status.tags.map { |tag| tag.name.mb_chars.downcase }.each do |hashtag|
Expand Down
2 changes: 2 additions & 0 deletions app/services/fan_out_on_write_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ def broadcast_to_public_streams!

redis.publish('timeline:public', anonymous_payload)
redis.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', anonymous_payload)
redis.publish('timeline:public:bubble', anonymous_payload) if @status.bubble?

if @status.with_media?
redis.publish('timeline:public:media', anonymous_payload)
redis.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', anonymous_payload)
redis.publish('timeline:public:bubble:media', anonymous_payload) if @status.bubble?
end
end

Expand Down
2 changes: 2 additions & 0 deletions app/services/remove_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def remove_from_public

redis.publish('timeline:public', @payload)
redis.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', @payload)
redis.publish('timeline:public:bubble', @payload) if @status.bubble?
end

def remove_from_media
Expand All @@ -146,6 +147,7 @@ def remove_from_media

redis.publish('timeline:public:media', @payload)
redis.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', @payload)
redis.publish('timeline:public:bubble:media', @payload) if @status.bubble?
end

def remove_from_direct
Expand Down

0 comments on commit 7ec4992

Please sign in to comment.