feat: chat reactions
This commit is contained in:
@@ -252,6 +252,28 @@ type Message struct {
|
||||
// Attachments is always present (possibly empty) so clients need no nil
|
||||
// check before iterating.
|
||||
Attachments []Attachment `json:"attachments"`
|
||||
// Reactions is always present (possibly empty), same contract as
|
||||
// Attachments — clients render the chip row without a nil check.
|
||||
Reactions []Reaction `json:"reactions"`
|
||||
}
|
||||
|
||||
// ReactionDetail is one person's reaction, for the "who reacted" list.
|
||||
type ReactionDetail struct {
|
||||
User ChatPeer `json:"user"`
|
||||
Emoji string `json:"emoji"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// Reaction is one emoji grouped across the people who chose it.
|
||||
//
|
||||
// Grouped rather than listed per user: a bubble shows "❤️ 3", and sending the
|
||||
// full membership of every reaction would grow with the room.
|
||||
type Reaction struct {
|
||||
Emoji string `json:"emoji"`
|
||||
Count int `json:"count"`
|
||||
// Mine marks the viewer's own choice, so the chip can be highlighted and
|
||||
// tapping it toggles off.
|
||||
Mine bool `json:"mine"`
|
||||
}
|
||||
|
||||
// Receipts are the conversation-wide delivery cursors used to draw ticks on
|
||||
|
||||
Reference in New Issue
Block a user