Reuse token-free message controls and render posting deliveries once

This commit is contained in:
GPT on behalf of DHH
2026-10-08 11:43:27 +02:00
parent e55b6dc3e5
commit 2c53c46767
11 changed files with 66 additions and 10 deletions
+3 -1
View File
@@ -28,7 +28,9 @@ class MessagesController < ApplicationController
set_room
@message = @room.messages.create_with_attachment!(message_params)
@message.broadcast_create
# Both deliveries contain the same token-free, viewer-independent markup.
@message_html = render_to_string partial: "messages/message", formats: :html, locals: { message: @message }
@message.broadcast_create(html: @message_html)
deliver_webhooks_to_bots
rescue ActiveRecord::RecordNotFound
render action: :room_not_found