DEV: Remove experimental site setting for chat threads (#22720)

We are removing the experimental site setting. Admins can now decide on a per channel basis to enable/disable threading. It's disabled by default.
This commit is contained in:
Jan Cernik
2023-07-26 07:46:23 -03:00
committed by GitHub
parent d06431ba9b
commit a2eb2b0490
67 changed files with 287 additions and 653 deletions

View File

@ -238,15 +238,13 @@ after_initialize do
add_to_serializer(:current_user, :chat_channels) do
structured = Chat::ChannelFetcher.structured(self.scope)
if SiteSetting.enable_experimental_chat_threaded_discussions
structured[:unread_thread_overview] = ::Chat::TrackingStateReportQuery.call(
guardian: self.scope,
channel_ids: structured[:public_channels].map(&:id),
include_threads: true,
include_read: false,
include_last_reply_details: true,
).thread_unread_overview_by_channel
end
structured[:unread_thread_overview] = ::Chat::TrackingStateReportQuery.call(
guardian: self.scope,
channel_ids: structured[:public_channels].map(&:id),
include_threads: true,
include_read: false,
include_last_reply_details: true,
).thread_unread_overview_by_channel
Chat::ChannelIndexSerializer.new(structured, scope: self.scope, root: false).as_json
end