settings: Add realm-level setting moderation_request_channel.

This commit introduces a new non-operational
`moderation_request_channel` field to the server/API. This setting will
support a feature allowing users to flag or report abusive content
(harassment, spam, etc.).

Fixes part of #20047.
This commit is contained in:
PieterCK
2024-12-03 12:37:27 +07:00
committed by Tim Abbott
parent 238c35f2af
commit 943fbb76fe
14 changed files with 243 additions and 5 deletions

View File

@@ -420,6 +420,12 @@ def fetch_initial_state_data(
else server_default_jitsi_server_url
)
moderation_request_channel = realm.get_moderation_request_channel()
if moderation_request_channel:
state["realm_moderation_request_channel_id"] = moderation_request_channel.id
else:
state["realm_moderation_request_channel_id"] = -1
new_stream_announcements_stream = realm.get_new_stream_announcements_stream()
if new_stream_announcements_stream:
state["realm_new_stream_announcements_stream_id"] = new_stream_announcements_stream.id