FIX: Do not serialize thread data if threading disabled (#21107)

Followup to ba11cf4767,
this commit makes it so that none of the chat message
thread data is serialized if threading_enabled is false
for the channel or if enable_experimental_chat_threaded_discussions
is false, there is no need to serialize the data in this
case.
This commit is contained in:
Martin Brennan
2023-04-17 14:29:06 +10:00
committed by GitHub
parent 274820d247
commit 9a15eab3ab
2 changed files with 49 additions and 1 deletions

View File

@@ -153,8 +153,16 @@ module Chat
end
end
def include_threading_data?
SiteSetting.enable_experimental_chat_threaded_discussions && channel.threading_enabled
end
def include_thread_id?
include_threading_data?
end
def include_thread_reply_count?
object.thread_id.present?
include_threading_data? && object.thread_id.present?
end
def thread_reply_count