FriendlyFez
final class FriendlyFez : Model, Searchable
extension FriendlyFez: Reportable
A FriendlyFez (Fez for short) is a multi person chat facilty.
Broadly speaking, Fezzes may be open or closed, chosen at creation time.
- Open fezzes generally have a publicly stated purpose, and may be for an event at a specific time and place. Open fezzes allow users to join and leave the fez at any time. Open fezzes may have posts with images, and can get moderated by mods. There is a search API for finding and joining public fezzes.
- Closed fezzes have a membership set at creation time (by the fez creator), and cannot have images in posts. Closed fezzes are very similar to V2’s Seamail facility.
Considered but not yet built are semi-open fezzes:
A semi-open fez would allow users to join after creation, but either the creator would have to invite new members or perhaps users could join via an invite link. Semi-open fezzes would not be searchable, would not be moderated, could not have images. Importantly, semi-open fezzes would indicate their semi-open state to their members, so that current members would know the membership list could change. New members to a semi-open fez would be able to read all past messages.
See
See Also: FezData the DTO for returning basic data on Fezzes.
See
See Also: FezContentData the DTO for creating or editing Fezzes.
See
See Also: CreateFriendlyFezSchema the Migration for creating the Fez table in the database.
-
Declaration
Swift
static let schema: String
-
Unique ID for this Fez.
Declaration
Swift
@ID var id: UUID?
-
The type of fez; what its purpose is..
Declaration
Swift
@Field var fezType: FezType
-
The title of the fez.
Declaration
Swift
@Field var title: String
-
A longer description of what the fez is about? Seems like this info could just go in the first post.
Declaration
Swift
@Field var info: String
-
Where the fez is happening.
Declaration
Swift
@OptionalField var location: String?
-
Moderators can set several statuses on fezPosts that modify editability and visibility.
Declaration
Swift
@Enum var moderationStatus: ContentModerationStatus
-
Start time for the fez. Only meaningful for public fezzes that are organizing an activity.
Declaration
Swift
@OptionalField var startTime: Date?
-
End time for the fez.
Declaration
Swift
@OptionalField var endTime: Date?
-
A minimum headcount needed for the fez to happen. Clients may want to highlight fezzes that are below min capacity in order to encourage users to join.
Declaration
Swift
@Field var minCapacity: Int
-
The max numbert of participants. The first
max_capacity
members ofparticipantArray
are the current participants; the rest of the array is the waitlist.Declaration
Swift
@Field var maxCapacity: Int
-
The number of posts in the fez. Should be equal to fezPosts.count. Value is cached here for quick access. When returning this value to a user, we subtrract the
hiddenCount
from the user’sFezParticipant
structure. Thus, different users could see differnt counts for the same fez.Declaration
Swift
@Field var postCount: Int
-
Declaration
Swift
@Field var cancelled: Bool
-
An ordered list of participants in the fez. Newly joined members are appended to the array, meaning this array stays sorted by join time..
Declaration
Swift
@Field var participantArray: [UUID]
-
The creator of the fez.
Declaration
Swift
@Parent var owner: User
-
The participants in the fez. The pivot
FezParticipant
also maintains the read count for each participant.Declaration
Swift
@Siblings var participants: [User]
-
The posts participants have made in the fez.
Declaration
Swift
@Children var fezPosts: [FezPost]
-
The child
FriendlyFezEdit
accountability records of the fez.Declaration
Swift
@Children var edits: [FriendlyFezEdit]
-
Timestamp of the model’s creation, set automatically.
Declaration
Swift
@Timestamp var createdAt: Date?
-
Timestamp of the model’s last update, set automatically.
Declaration
Swift
@Timestamp var updatedAt: Date?
-
Timestamp of the model’s soft-deletion, set automatically.
Declaration
Swift
@Timestamp var deletedAt: Date?
-
Declaration
Swift
init()
-
Initializes a new FriendlyFez.
Declaration
Swift
init( owner: UUID, fezType: FezType, title: String = "", info: String = "", location: String?, startTime: Date?, endTime: Date?, minCapacity: Int = 0, maxCapacity: Int = 0 )
Parameters
owner
The ID of the owning entity.
fezType
The type of fez being created.
title
The title of the Fez.
location
Where the Fez is being held.
startTime
When participants should arrive.
endTime
Estimated time the fez will complete.
minCapacity
How many people are needed make a quorum.
maxCapactiy
The max # of people who can attend. Users who join past this number are waitlisted.
-
Initializes a closed FriendlyFez, also known as a Chat session.
Declaration
Swift
init(owner: UUID)
-
The report type for
FriendlyFez
reports.Declaration
Swift
var reportType: ReportType { get }
-
Standardizes how to get the author ID of a Reportable object.
Declaration
Swift
var authorUUID: UUID { get }
-
No auto quarantine for fezzes.
Declaration
Swift
var autoQuarantineThreshold: Int { get }
-
Declaration
Swift
func notificationType() throws -> NotificationType