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
-
moderatorRootPageHandler(_:
Asynchronous) Declaration
Swift
func moderatorRootPageHandler(_ req: Request) async throws -> View
-
archivedImageHandler(_:
Asynchronous) 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
-
closedReportsPageHandler(_:
Asynchronous) 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
-
beginProcessingReportsPostHandler(_:
Asynchronous) 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
-
closeReportsPostHandler(_:
Asynchronous) 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
-
moderatorLogPageHandler(_:
Asynchronous) Declaration
Swift
func moderatorLogPageHandler(_ req: Request) async throws -> View
-
moderatorSeamailPageHandler(_:
Asynchronous) Declaration
Swift
func moderatorSeamailPageHandler(_ req: Request) async throws -> View
-
moderatorGuidePageHandler(_:
Asynchronous)
See moreGET /moderator/guide
Declaration
Swift
func moderatorGuidePageHandler(_ req: Request) async throws -> View
-
moderateTwarrtContentPageHandler(_:
Asynchronous) 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
Declaration
Swift
func moderateTwarrtContentPageHandler(_ req: Request) async throws -> View
-
setTwarrtModerationStatePostHandler(_:
Asynchronous) 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
-
moderateForumPostContentPageHandler(_:
Asynchronous) 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 *
Declaration
Swift
func moderateForumPostContentPageHandler(_ req: Request) async throws -> View
-
setForumPostModerationStatePostHandler(_:
Asynchronous) 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
-
moderateForumContentPageHandler(_:
Asynchronous) 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 *
Declaration
Swift
func moderateForumContentPageHandler(_ req: Request) async throws -> View
-
setForumCategoryPostHandler(_:
Asynchronous) 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
-
setForumModerationStatePostHandler(_:
Asynchronous) 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
-
moderateFezContentPageHandler(_:
Asynchronous) 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 *
Declaration
Swift
func moderateFezContentPageHandler(_ req: Request) async throws -> View
-
setFezModerationStatePostHandler(_:
Asynchronous) 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
-
moderateFezPostContentPageHandler(_:
Asynchronous) 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 *
Declaration
Swift
func moderateFezPostContentPageHandler(_ req: Request) async throws -> View
-
setFezPostModerationStatePostHandler(_:
Asynchronous) 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
-
getMicroKaraokeSongsPageHandler(_:
Asynchronous) 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
Declaration
Swift
func getMicroKaraokeSongsPageHandler(_ req: Request) async throws -> View
-
moderateMicroKaraokeSongPageHandler(_:
Asynchronous) 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 moreDeclaration
Swift
func moderateMicroKaraokeSongPageHandler(_ req: Request) async throws -> View
-
setMKSongApprovalState(_:
Asynchronous) 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
-
moderatePhotostreamPhotoPageHandler(_:
Asynchronous) Declaration
Swift
func moderatePhotostreamPhotoPageHandler(_ req: Request) async throws -> View
-
modDeletePhotostreamPhoto(_:
Asynchronous) POST /moderate/photostream/:photo_ID/delete
DELETE /moderate/photostream/:photo_ID
Deletes the given photo from the photostream.
Declaration
Swift
func modDeletePhotostreamPhoto(_ req: Request) async throws -> HTTPStatus
-
moderateUserProfileContentPageHandler(_:
Asynchronous) GET /moderate/userprofile/ID
Info from user’s profile. Previous profile versions, reports against the user’s profile fields or avatar image.
See moreDeclaration
Swift
func moderateUserProfileContentPageHandler(_ req: Request) async throws -> View
-
setUserProfileModerationStatePostHandler(_:
Asynchronous) 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
-
moderateUserContentPageHandler(_:
Asynchronous) 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 moreDeclaration
Swift
func moderateUserContentPageHandler(_ req: Request) async throws -> View
-
setUserAccessLevelPostHandler(_:
Asynchronous) 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
-
applyTempBanPostHandler(_:
Asynchronous) 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
See more.quarantined
for the duration, after which the user’s accessLevel reverts to what it was previously.Declaration
Swift
func applyTempBanPostHandler(_ req: Request) async throws -> HTTPStatus
-
removeTempBanPostHandler(_:
Asynchronous) 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
-
moderatePersonalEventPageHandler(_:
Asynchronous) Declaration
Swift
func moderatePersonalEventPageHandler(_ req: Request) async throws -> View
-
personalEventMemberRemoveHandler(_:
Asynchronous) POST /moderate/personalevent/:eventID/members/:userID/remove
Remove a user from the PersonalEvent
Declaration
Swift
func personalEventMemberRemoveHandler(_ req: Request) async throws -> HTTPStatus