CommunitySupportReport

final class CommunitySupportReport : Model, @unchecked Sendable

A report written up by a Community Support team member about something an attendee told them.

Deliberately not Reportable or ContentFilterable: these records aren’t public user content, must never enter the moderator report queue, and need no image uploads, alertword scanning, or mention processing. They’re readable only by Community Support role holders and TwitarrTeam and above.

See

See Also: CommunitySupportAction, the append-only log of what the team did with each report.

Properties

Relations

  • The team member who filed the report.

    Declaration

    Swift

    @CommunitySupportReport
    .Parent var author: User { get set }
  • The reporter, if they have an account and the team member picked it. Set to nil if that account is deleted.

    Declaration

    Swift

    @CommunitySupportReport
    .OptionalParent var reporter: User? { get set }
  • The person the report is about, if picked from the user list.

    Declaration

    Swift

    @CommunitySupportReport
    .OptionalParent var subject: User? { get set }
  • The discussion thread in the private Community Support forum, if someone has started one. If the thread is deleted this goes back to nil and a new one can be started. Follows the precedent of Event.forum.

    Declaration

    Swift

    @CommunitySupportReport
    .OptionalParent var forum: Forum? { get set }
  • The log entries about this report.

    Declaration

    Swift

    @CommunitySupportReport
    .Children var actions: [CommunitySupportAction] { get set }

Initialization

  • Declaration

    Swift

    init()
  • Creates a report from a submitted form. A report whose intent is “information only” starts out as .infoOnly; anything else starts .new.

    Declaration

    Swift

    init(author: UUID, data: CommunitySupportReportCreateData)
  • The longest post text the forum accepts is 2048 characters (see PostContentData.validations()). Stay comfortably under it.

    Declaration

    Swift

    static let discussionPostCharacterLimit: Int
  • A descriptive title for the report: “Name - Location - When”, where the name is that of the person the report is about. That’s the typed subject name, falling back to the linked account’s username, then to “Unspecified” when neither was given.

    Declaration

    Swift

    func displayTitle(subjectUsername: String? = nil) -> String

    Parameters

    subjectUsername

    The username of the linked subject account, if there is one. The model only has its ID, so the caller looks it up.

  • The title for the discussion thread started from this report: its displayTitle, cut to the 100 character forum title limit.

    Declaration

    Swift

    func discussionTitle(subjectUsername: String? = nil) -> String
  • The address of this report’s page on the site, as a full URL on the server’s canonical address.

    Declaration

    Swift

    var reportURL: String { get }
  • The text of the first post of the discussion thread: a full copy of the report, ending with a link back to it.

    Forum posts are limited in length and a report may not fit. When it doesn’t, the free-text fields are cut down together (the longest are trimmed first) so that no field is dropped entirely, and a note points to the full report. The report table stays the record of truth.

    Declaration

    Swift

    func discussionPostText() -> String