feat: add stickers
This commit is contained in:
@@ -171,11 +171,16 @@ const (
|
||||
// app-relative deep link back to the phrase, title the source reference,
|
||||
// description the passage itself.
|
||||
AttachmentQuote = "quote"
|
||||
// AttachmentSticker is reward artwork: image_url and title carry the art
|
||||
// and its name, entity_id the reward key a recipient can save by.
|
||||
AttachmentSticker = "sticker"
|
||||
)
|
||||
|
||||
// Entity types a message can reference.
|
||||
const (
|
||||
EntityPost = "post"
|
||||
// EntitySticker marks a sticker attachment's entity_id as a reward key.
|
||||
EntitySticker = "sticker"
|
||||
)
|
||||
|
||||
// Attachment is a media file, link preview or shared entity on a message.
|
||||
@@ -257,6 +262,17 @@ type Message struct {
|
||||
Reactions []Reaction `json:"reactions"`
|
||||
}
|
||||
|
||||
// Sticker is one piece of reward artwork, as it appears in the picker and on
|
||||
// a message.
|
||||
type Sticker struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
ImageURL string `json:"image_url"`
|
||||
// Saved is true when it came from a chat rather than from sādhana, so the
|
||||
// picker can say where it came from.
|
||||
Saved bool `json:"saved"`
|
||||
}
|
||||
|
||||
// ReactionDetail is one person's reaction, for the "who reacted" list.
|
||||
type ReactionDetail struct {
|
||||
User ChatPeer `json:"user"`
|
||||
|
||||
@@ -52,9 +52,16 @@ type SadhnaReward struct {
|
||||
// SadhnaRewardGrant is a reward a user earned at a streak milestone (a
|
||||
// multiple of 7 days). The full reward is embedded for direct rendering.
|
||||
type SadhnaRewardGrant struct {
|
||||
Milestone int `json:"milestone"`
|
||||
// Milestone is the streak day this was earned on. Nil for an admin gift,
|
||||
// which isn't tied to a streak at all.
|
||||
Milestone *int `json:"milestone"`
|
||||
GrantedAt time.Time `json:"granted_at"`
|
||||
Reward SadhnaReward `json:"reward"`
|
||||
// Source is "streak" or "gift".
|
||||
Source string `json:"source"`
|
||||
// Opened is false while a gift is still wrapped — the gallery renders
|
||||
// those blurred until the devotee opens them.
|
||||
Opened bool `json:"opened"`
|
||||
}
|
||||
|
||||
// SadhnaDashboard is the single payload the /sadhna-streak page reads. It
|
||||
|
||||
Reference in New Issue
Block a user