fix: chat accepts posts

This commit is contained in:
Krispire Admin
2026-08-29 16:26:38 +05:30
parent 18bac9a22d
commit 7a730cd42e
8 changed files with 545 additions and 22 deletions
+15
View File
@@ -173,6 +173,11 @@ const (
AttachmentQuote = "quote"
)
// Entity types a message can reference.
const (
EntityPost = "post"
)
// Attachment is a media file, link preview or shared entity on a message.
//
// Media carries an R2 key rather than a URL: chat media lives in the private
@@ -201,6 +206,16 @@ type Attachment struct {
SiteName *string `json:"site_name,omitempty"`
ImageURL *string `json:"image_url,omitempty"`
// Shared entity (a post, for now). EntityType/EntityID are the durable
// reference; Entity is resolved per viewer at read time, so the same row
// renders differently — or not at all — depending on who is looking.
EntityType *string `json:"entity_type,omitempty"`
EntityID *string `json:"entity_id,omitempty"`
Entity json.RawMessage `json:"entity,omitempty"`
// EntityUnavailable is set when the entity was deleted, hidden, or the
// viewer has since lost access. The client renders a tombstone.
EntityUnavailable bool `json:"entity_unavailable,omitempty"`
CreatedAt time.Time `json:"created_at"`
}