refactor(message): add helper to update contents of simple text message

Add update_content() helper so code outside of history module does not
need to know details of the message structure.
This commit is contained in:
Dmitry Torokhov
2025-07-17 22:28:18 -07:00
committed by yetone
parent e82b159f65
commit 394e4d79eb
2 changed files with 8 additions and 1 deletions

View File

@@ -979,7 +979,7 @@ function M._stream(opts)
opts.on_chunk(prefix .. "\n" .. msg_content .. "\n")
end
if opts.on_messages_add and message then
message.message.content = "\n\n" .. msg_content
message:update_content("\n\n" .. msg_content)
opts.on_messages_add({ message })
end