A platform for community discussion. Free, open, simple.
FIX: chat replies are not always in a thread (#27023)
Régis Hanol02469d5795ab
diff --git a/plugins/chat/app/models/chat/message.rb b/plugins/chat/app/models/chat/message.rbindex 59f3d04fc9b..32cf71b1092 100644--- a/plugins/chat/app/models/chat/message.rb+++ b/plugins/chat/app/models/chat/message.rb@@ -266,7 +266,7 @@ module Chatenddef in_thread?- self.thread_id.present?+ self.thread_id.present? && self.chat_channel.threading_enabledenddef thread_reply?diff --git a/plugins/chat/spec/requests/chat/api/messages_controller_spec.rb b/plugins/chat/spec/requests/chat/api/messages_controller_spec.rbindex a7e4dd44c99..0bc3cf2b170 100644--- a/plugins/chat/spec/requests/chat/api/messages_controller_spec.rb+++ b/plugins/chat/spec/requests/chat/api/messages_controller_spec.rb@@ -205,7 +205,9 @@ RSpec.describe Chat::Api::ChannelMessagesController dolet(:message) { "This is a message" }describe "for category" do- fab!(:chat_channel) { Fabricate(:category_channel, chatable: category) }+ fab!(:chat_channel) do+ Fabricate(:category_channel, chatable: category, threading_enabled: true)+ endbefore dochat_channel.add(user)diff --git a/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb b/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rbindex d1b921614e3..3fa514dedd0 100644--- a/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb+++ b/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb@@ -70,7 +70,7 @@ RSpec.describe "User menu notifications | sidebar", type: :system doendcontext "when category channel" do- fab!(:channel_1) { Fabricate(:chat_channel) }+ fab!(:channel_1) { Fabricate(:chat_channel, threading_enabled: true) }before doJobs.run_immediately!