Twarrt
final class Twarrt : Model, Searchableextension Twarrt: ContentFilterableextension Twarrt: ReportableAn individual post in the Twitarr stream. Posts must contain text content, and may also contain images.
Twarrts are content that can be quarantined or locked by moderators. A quarantined twarrt will have its contents replaced with a quarantine message, and will not have any images. A locked twarrt can only be modified by moderators. When edited, twarrts create edit records showing previous state for moderation purposes.
V2 of Twitarr (and, actual Twitter) have tweet replies that work as a directed acyclic graph. Any tweet can be created as a reply to an existing tweet,
a tweet can have multiple direct reply tweets, and a tweet can be both a reply to another tweet and the target of other replies. V3 doesn’t work that way.
A new twarrt replying to a twarrt not already in a Reply Group creates a Reply Group, and both the replied–to and reply twarrt have their replyGroup
set to the ID of the replied-to twarrt. A reply to a twarrt already in a Reply Group gets added to the Reply Group.
This means that any twarrt that has a non-null replyGroup has a thread can can be retrieved. It also means that replies are one level deep–a reply to a reply is not considered differernt than a 2 replies to a single twarrt.
See
See Also: TwarrtData the DTO for returning basic data on Twarrts.See
See Also: TwarrtDetailData the DTO for returning basic data on Twarrts.See
See Also: PostData the DTO for creating or editing Twarrts.See
See Also: CreateTwarrtSchema the Migration for creating the Twarrts table in the database.- 
                  
                  DeclarationSwift static let schema: String
- 
                  
                  The twarrt’s ID. DeclarationSwift @ID var id: Int?
- 
                  
                  The text content of the twarrt. DeclarationSwift @Field var text: String
- 
                  
                  The filenames of any images for the post. DeclarationSwift @OptionalField var images: [String]?
- 
                  
                  Moderators can set several statuses on twarrts that modify editability and visibility. DeclarationSwift @Enum var moderationStatus: ContentModerationStatus
- 
                  
                  Timestamp of the model’s creation, set automatically. DeclarationSwift @Timestamp var createdAt: Date?
- 
                  
                  Timestamp of the model’s last update, set automatically. DeclarationSwift @Timestamp var updatedAt: Date?
- 
                  
                  Timestamp of the model’s soft-deletion, set automatically. DeclarationSwift @Timestamp var deletedAt: Date?
- 
                  
                  The twarrt’s author. DeclarationSwift @Parent var author: User
- 
                  
                  When a twarrt is created as a reply to another twarrt, both twarrts get their replyGroupset to the ID of the replied-to twarrt. When a reply is created and the replied-to twarrt is already in a reply group, the new reply joins the existing reply group.DeclarationSwift @OptionalParent var replyGroup: Twarrt?
- 
                  
                  The child TwarrtEditaccountability records of the twarrt.DeclarationSwift @Children var edits: [TwarrtEdit]
- 
                  
                  DeclarationSwift init()
- 
                  
                  Initializes a new Twarrt. DeclarationSwift init(authorID: UUID, text: String, images: [String]? = nil, replyTo: Twarrt? = nil) throwsParametersauthorThe author of the twarrt. textThe text content of the twarrt. imageThe filename of any image content of the twarrt. replyToThe twarrt being replied to, if any. 
- 
                  
                  DeclarationSwift func contentTextStrings() -> [String]
- 
                  
                  The type for Twarrtreports.DeclarationSwift var reportType: ReportType { get }
- 
                  
                  DeclarationSwift var authorUUID: UUID { get }
- 
                  
                  DeclarationSwift var autoQuarantineThreshold: Int { get }
 View on GitHub
            View on GitHub
           Twarrt Class Reference
      Twarrt Class Reference