From dfe8e7bd5d42c2533d87f9b56fed755c2c5a2d51 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 2 Dec 2025 18:10:49 +0100 Subject: [PATCH] Scope general broadcasts by account Because DoS ourselves is not fun --- app/models/board/broadcastable.rb | 1 + app/views/cards/_broadcasts.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/board/broadcastable.rb b/app/models/board/broadcastable.rb index facb23ee4..f5481a9ff 100644 --- a/app/models/board/broadcastable.rb +++ b/app/models/board/broadcastable.rb @@ -3,5 +3,6 @@ module Board::Broadcastable included do broadcasts_refreshes + broadcasts_refreshes_to ->(board) { [ board.account, :all_boards ] } end end diff --git a/app/views/cards/_broadcasts.html.erb b/app/views/cards/_broadcasts.html.erb index 87c21e05d..04114b1f4 100644 --- a/app/views/cards/_broadcasts.html.erb +++ b/app/views/cards/_broadcasts.html.erb @@ -3,5 +3,5 @@ <%= turbo_stream_from board %> <% end %> <% else %> - <%= turbo_stream_from :all_boards %> + <%= turbo_stream_from [ Current.account, :all_boards ] %> <% end %>