From 76aa9b66d04b065877b07c20ada8c66246b24e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Wed, 16 Oct 2024 12:22:55 +0200 Subject: [PATCH] DEV: Allow `ChatSDK.create` to take extra parameters Currently, `ChatSDK.create` restricts what parameters can be provided to the underlying service. This prevents the `discourse-ai` plugin from using it in one of its specs. This patch allows extra parameters to be provided. --- plugins/chat/lib/chat_sdk/message.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/chat/lib/chat_sdk/message.rb b/plugins/chat/lib/chat_sdk/message.rb index 72f46ed44fd..64079713239 100644 --- a/plugins/chat/lib/chat_sdk/message.rb +++ b/plugins/chat/lib/chat_sdk/message.rb @@ -116,6 +116,7 @@ module ChatSDK enforce_membership: false, force_thread: false, strip_whitespaces: true, + **params, &block ) message = @@ -131,6 +132,7 @@ module ChatSDK force_thread: force_thread, strip_whitespaces: strip_whitespaces, created_by_sdk: true, + **params, ) do on_model_not_found(:channel) { raise "Couldn't find channel with id: `#{channel_id}`" } on_model_not_found(:membership) do