FriendlyFez
final class FriendlyFez : Model, Searchable, @unchecked Sendable
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
@FriendlyFez .ID var id: UUID? { get set }
-
The type of fez; what its purpose is..
Declaration
Swift
@FriendlyFez .Field var fezType: FezType { get set }
-
The title of the fez.
Declaration
Swift
@FriendlyFez .Field var title: String { get set }
-
A longer description of what the fez is about? Seems like this info could just go in the first post.
Declaration
Swift
@FriendlyFez .Field var info: String { get set }
-
Where the fez is happening.
Declaration
Swift
@FriendlyFez .OptionalField var location: String? { get set }
-
Moderators can set several statuses on fezPosts that modify editability and visibility.
Declaration
Swift
@FriendlyFez .Enum var moderationStatus: ContentModerationStatus { get set }
-
Start time for the fez. Only meaningful for public fezzes that are organizing an activity.
Declaration
Swift
@FriendlyFez .OptionalField var startTime: Date? { get set }
-
End time for the fez.
Declaration
Swift
@FriendlyFez .OptionalField var endTime: Date? { get set }
-
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
@FriendlyFez .Field var minCapacity: Int { get set }
-
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
@FriendlyFez .Field var maxCapacity: Int { get set }
-
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
@FriendlyFez .Field var postCount: Int { get set }
-
Declaration
Swift
@FriendlyFez .Field var cancelled: Bool { get set }
-
An ordered list of participants in the fez. Newly joined members are appended to the array, meaning this array stays sorted by join time. List includes the creator.
Declaration
Swift
@FriendlyFez .Field var participantArray: [UUID] { get set }
-
The creator of the fez.
Declaration
Swift
@FriendlyFez .Parent var owner: User { get set }
-
The participants in the fez. The pivot
FezParticipant
also maintains the read count for each participant.Declaration
Swift
@FriendlyFez .Siblings var participants: [User] { get set }
-
The posts participants have made in the fez.
Declaration
Swift
@FriendlyFez .Children var fezPosts: [FezPost] { get set }
-
The child
FriendlyFezEdit
accountability records of the fez.Declaration
Swift
@FriendlyFez .Children var edits: [FriendlyFezEdit] { get set }
-
Timestamp of the model’s creation, set automatically.
Declaration
Swift
@FriendlyFez .Timestamp var createdAt: Date? { get set }
-
Timestamp of the model’s last update, set automatically.
Declaration
Swift
@FriendlyFez .Timestamp var updatedAt: Date? { get set }
-
Timestamp of the model’s soft-deletion, set automatically.
Declaration
Swift
@FriendlyFez .Timestamp var deletedAt: Date? { get set }
-
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 }