The notifications chat moderation sends: alerting admins that a report landed, warning a player, telling a player they were muted, and telling a reporter what came of their report.
Every message has a default_* function so the admin console can prefill the
box and let a moderator edit it before sending. The text is the moderator's,
not core's — these are only sensible starting points.
All of them go through Notifications.admin_create_notification/3 with the
recipient as their own sender. That is the same trick chat notifications use:
the notification table upserts on (sender_id, recipient_id, title), so a
player who is muted twice keeps one "You have been muted" entry (re-marked
unread) instead of collecting a pile, and an admin sees one standing "New
chat reports" alert rather than one per report.
Summary
Functions
Default body for the notice a muted player receives.
Default body for the reply a reporter receives once their report is handled.
Default body for a moderator warning about a reported message.
Title used for the player mute notice.
Tell every admin that a report is waiting.
Send message to a muted player.
Tell a reporter what came of their report.
Send a warning to a player.
Title used when telling a reporter their report was handled.
Title used for the admin report alert (constant, so alerts collapse).
Title used for a moderator warning.
Functions
@spec default_mute_message(Gamend.Chat.Mute.t()) :: String.t()
Default body for the notice a muted player receives.
Default body for the reply a reporter receives once their report is handled.
Default body for a moderator warning about a reported message.
@spec mute_title() :: String.t()
Title used for the player mute notice.
@spec notify_admins_of_report(non_neg_integer()) :: :ok
Tell every admin that a report is waiting.
Best-effort and fire-and-forget: a failure here must never take down the report that triggered it.
@spec notify_muted(Ecto.UUID.t(), String.t()) :: :ok
Send message to a muted player.
@spec notify_reporter(Ecto.UUID.t(), String.t()) :: :ok
Tell a reporter what came of their report.
@spec notify_warning(Ecto.UUID.t(), String.t()) :: :ok
Send a warning to a player.
@spec report_resolved_title() :: String.t()
Title used when telling a reporter their report was handled.
@spec report_title() :: String.t()
Title used for the admin report alert (constant, so alerts collapse).
@spec warning_title() :: String.t()
Title used for a moderator warning.