Reportable

protocol Reportable
  • The type of report to use when reportong on this object type.

    Declaration

    Swift

    var reportType: ReportType { get }
  • The UUID of the content’s author.

    Declaration

    Swift

    var authorUUID: UUID { get }
  • How many reports on this type of content must accrue before triggering auto-quarantine.

    Declaration

    Swift

    var autoQuarantineThreshold: Int { get }
  • Things that can get reported can get moderated by the mod team. This shows the moderation status of the reportable item.

    Declaration

    Swift

    var moderationStatus: ContentModerationStatus { get set }
  • The database ID of the content. Depending on reportType, this could encode either a UUID or an Int. Don’t use this for concrete types where the actual @id type is available.

    Declaration

    Swift

    func reportableContentID() throws -> String
  • isQuarantined Extension method

    Declaration

    Swift

    var isQuarantined: Bool { get }
  • fileReport(submitter:submitterMessage:on:) Extension method, asynchronous

    Creates and saves a Report. Reports are always submitted by the parent account of any sub-account. A user may only file one report against a piece of content. If enough reports are filed against the same piece of content, this function will mark the content auto-quarantined.

    Declaration

    Swift

    func fileReport(submitter: UserCacheData, submitterMessage: String, on req: Request) async throws -> HTTPStatus
  • logIfModeratorAction(_:user:on:) Extension method, asynchronous

    If the change being made to the receiver is a mod exercising their mod powers, record the change in the ModeratorAction log. If the change isn’t the result of mod powers, do nothing. Most calls don’t need to wait for completion, and can ignore the result. Only call this function after you’re sure the action is actually going to occur.

    Declaration

    Swift

    func logIfModeratorAction(_ action: ModeratorActionType, user: UserCacheData, on req: Request) async
  • logIfModeratorAction(_:moderatorID:on:) Extension method, asynchronous

    If the change being made to the receiver is a mod exercising their mod powers, record the change in the ModeratorAction log. If the change isn’t the result of mod powers, do nothing. Most calls don’t need to wait for completion, and can ignore the result. Only call this function after you’re sure the action is actually going to occur.

    Declaration

    Swift

    func logIfModeratorAction(_ action: ModeratorActionType, moderatorID: UUID, on req: Request) async throws