FEATURE: Log topic slow mode changes (#27934)

Previously, we did not log any topic slow mode changes. This allowed
some malicious (or just careless) TL4 users to delete slow modes created
by moderators at will. Administrators could not see who changed the slow
mode unless they had SQL knowledge and used Data Explorer.

This commit enables logging who turns slow mode on, off, or changes it.

Related meta topic: https://meta.discourse.org/t/why-is-there-no-record-of-who-added-or-removed-slow-mode/316354
This commit is contained in:
锦心
2024-07-16 17:08:09 +08:00
committed by GitHub
parent 3bc459e178
commit 600f2854c7
5 changed files with 48 additions and 0 deletions

View File

@ -1186,6 +1186,13 @@ class TopicsController < ApplicationController
topic.set_or_create_timer(slow_mode_type, time, by_user: timer&.user)
StaffActionLogger.new(current_user).log_topic_slow_mode(
topic,
enabled:,
seconds: params[:seconds],
until: time,
)
head :ok
end