SiteModController

struct SiteModController : SiteControllerUtils

SiteModController handles a bunch of pages that exist to moderate user content. There’s a .moderator value in UserAccessLevel, but that doesn’t mean that everything in this controller is accessible by moderators.

The SiteAdminController, by contrast, is responsible for the web front-end to the administration functions, such as server configuration, uploading reg codes/calendars/song lists/game lists, performance monitoring, security, and client management.

  • Declaration

    Swift

    func registerRoutes(_ app: Application) throws
  • Declaration

    Swift

    func moderatorRootPageHandler(_ req: Request) async throws -> View
  • GET /archivedimage/ID

    Moderators only. Returns an image from the image archive (user images that have been replaced by subsequent edits).

    Declaration

    Swift

    func archivedImageHandler(_ req: Request) async throws -> Response
  • reportsPageHandler(_:) Asynchronous

    GET /reports

    Shows moderators a summary of user-submitted reports, grouped by the content that was reported.

    Declaration

    Swift

    func reportsPageHandler(_ req: Request) async throws -> View
  • GET /reports/closed

    Shows moderators a summary of user-submitted reports, grouped by the content that was reported.

    Declaration

    Swift

    func closedReportsPageHandler(_ req: Request) async throws -> View
  • POST /reports/ID/handle

    Marks all reports reporting a specific piece of content as being handled by the current user. While a moderator is handling a report, any moderation actions taken get tied to the report being handled. Also, reports being handled are marked as such so other moderators can hopefully avoid duplicate work. Mods should close reports when they’re done to complete the flow.

    Declaration

    Swift

    func beginProcessingReportsPostHandler(_ req: Request) async throws -> HTTPStatus
  • POST /reports/ID/close

    Sets the state of all reports in a group to Closed. Although it takes an ID of one report, it finds all reports that refer to the same pirce of content, and closes all of them.

    Declaration

    Swift

    func closeReportsPostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderator/log

    Shows a page with a table of all moderator actions.

    See more

    Declaration

    Swift

    func moderatorLogPageHandler(_ req: Request) async throws -> View
  • Declaration

    Swift

    func moderatorSeamailPageHandler(_ req: Request) async throws -> View
  • GET /moderator/guide

    See more

    Declaration

    Swift

    func moderatorGuidePageHandler(_ req: Request) async throws -> View
  • GET /moderate/twarrt/ID

    This shows a view that focuses on the content that was reported, showing:

    • The twarrt that was reported
    • All reports made against this content
    • All previous versions of this content
    • (hopefully) Mod actions taken against this content already
    See more

    Declaration

    Swift

    func moderateTwarrtContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/twarrt/ID/setstate/STRING

    Sets the moderation state of the given twarrt. Moderation states include “locked” and “quarantined”, as well as a few others.

    Declaration

    Swift

    func setTwarrtModerationStatePostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/forumpost/:post_ID

    This shows a view that focuses on the content that was reported, showing:

    • The post that was reported
    • All reports made against this content
    • All previous versions of this content
    • (hopefully) Mod actions taken against this content already *
    See more

    Declaration

    Swift

    func moderateForumPostContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/forumpost/ID/setstate/STRING

    Sets the moderation state of the given forum post. Moderation states include “locked” and “quarantined”, as well as a few others.

    Declaration

    Swift

    func setForumPostModerationStatePostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/forum/:forum_ID

    This shows a view that focuses on the content that was reported, showing:

    • The forum that was reported
    • All reports made against this content
    • All previous versions of this content
    • (hopefully) Mod actions taken against this content already *
    See more

    Declaration

    Swift

    func moderateForumContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/forum/:forum_ID/move/:category_ID

    Moves a forum thread into a new category. Once moved, the thread will have the same restrictions on viewability as other threads in the destination category. This means we could make a ‘forum dumpster’ category that was mod-only and mods could move awful forum threads into it, and later review individual posts and hand out bans. The utility of this approach is: without this we don’t have a way to get a forum out of circulation without deleting the whole forum.

    Declaration

    Swift

    func setForumCategoryPostHandler(_ req: Request) async throws -> HTTPStatus
  • POST /moderate/forum/ID/setstate/STRING

    Sets the moderation state of the given forum. Moderation states include “locked” and “quarantined”, as well as a few others.

    Declaration

    Swift

    func setForumModerationStatePostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/lfg/:fez_ID

    This shows a view that focuses on the content that was reported, showing:

    • The Fez that was reported
    • All reports made against this content
    • All previous versions of this content
    • (hopefully) Mod actions taken against this content already *
    See more

    Declaration

    Swift

    func moderateFezContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/lfg/ID/setstate/STRING

    Sets the moderation state of the given fez. Moderation states include “locked” and “quarantined”, as well as a few others.

    Declaration

    Swift

    func setFezModerationStatePostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/fezpost/:fezpost_ID

    This shows a view that focuses on the content that was reported, showing:

    • The Fez Post that was reported
    • All reports made against this content
    • All previous versions of this content
    • (hopefully) Mod actions taken against this content already *
    See more

    Declaration

    Swift

    func moderateFezPostContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/fezpost/:post_ID/setstate/STRING

    Sets the moderation state of the given fez. Moderation states include “locked” and “quarantined”, as well as a few others.

    Declaration

    Swift

    func setFezPostModerationStatePostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/microkaraoke

    This shows a view that shows the MicroKaraoke songs that are:

    • Completed/Approved: Approved by mods, ready for viewing by all users.
    • Completed/Not Approved: Not yet approved, but all necessary video clips have been uploaded
    • Not Completed: Songs that do not yet have all their video clips uploaded
    See more

    Declaration

    Swift

    func getMicroKaraokeSongsPageHandler(_ req: Request) async throws -> View
  • GET /moderate/microkaraoke/song/:song_id

    For a specific Micro Karaoke song, shows a list of each video clip that makes up the song, along with the user that recorded that clip and a ‘Reject’ button for moderation purposes.

    See more

    Declaration

    Swift

    func moderateMicroKaraokeSongPageHandler(_ req: Request) async throws -> View
  • POST /moderate/microkaraoke/:song_ID/approve

    Approves the given song for publish. Notifies all contributors that their song is ready for viewing.

    Declaration

    Swift

    func setMKSongApprovalState(_ req: Request) async throws -> HTTPStatus
  • deleteMKSnippet(_:) Asynchronous

    POST /microkaraoke/snippet/:snippet_ID/delete

    Approves the given song for publish. Notifies all contributors that their song is ready for viewing.

    Declaration

    Swift

    func deleteMKSnippet(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/userprofile/ID

    Info from user’s profile. Previous profile versions, reports against the user’s profile fields or avatar image.

    See more

    Declaration

    Swift

    func moderateUserProfileContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/userprofile/ID/setstate/STRING

    Sets the moderation state of the given user’s profile. ID is a userID UUID.. Moderation states include “locked” and “quarantined”, as well as a few others. Again: Setting the state to “locked” prevents the user from modifying their profile and avatar, but doesn’t otherwise constrain them. Similarly, quarantine state prevents others from seeing the avatar and profile field text, but doesn’t prevent the user from posting content.

    Declaration

    Swift

    func setUserProfileModerationStatePostHandler(_ req: Request) async throws -> HTTPStatus
  • GET /moderate/user/ID

    Shows the User Moderation page, which has the user’s accessLevel controls, temp banning, and a list of all reports filed against any of this user’s content.

    See more

    Declaration

    Swift

    func moderateUserContentPageHandler(_ req: Request) async throws -> View
  • POST /moderate/user/ID/setaccesslevel/STRING

    Sets the moderation state of the given user’s profile. ID is a userID UUID.. Moderation states include “locked” and “quarantined”, as well as a few others. Again: Setting the state to “locked” prevents the user from modifying their profile and avatar, but doesn’t otherwise constrain them. Similarly, quarantine state prevents others from seeing the avatar and profile field text, but doesn’t prevent the user from posting content.

    Declaration

    Swift

    func setUserAccessLevelPostHandler(_ req: Request) async throws -> HTTPStatus
  • POST /moderate/user/ID/tempquarantine

    Applies a temporary quarantine to the user given by ID. While quarantined, the user may not create or edit content, but can still log in and read others’ content. They can still talk in private Seamail chats. They cannot edit their profile or change their avatar image. Temp quarantines effectively change the user’s accessLevel to .quarantined for the duration, after which the user’s accessLevel reverts to what it was previously.

    See more

    Declaration

    Swift

    func applyTempBanPostHandler(_ req: Request) async throws -> HTTPStatus
  • POST /moderate/user/ID/tempquarantine/delete

    Applies a temporary quarantine to the user given by ID. While quarantined, the user may not create or edit content, but can still log in and read others’ content. They can still talk in private Seamail chats. They cannot edit their profile or change their avatar image. Temp quarantines effectively change the user’s accessLevel to .quarantined for the duration, after which the user’s accessLevel reverts to what it was previously.

    Declaration

    Swift

    func removeTempBanPostHandler(_ req: Request) async throws -> HTTPStatus