From b0e374f88e4f1e22f866fe0e014b6515195dfc2b Mon Sep 17 00:00:00 2001 From: Vragov Roman Date: Mon, 14 Oct 2024 15:28:26 +0300 Subject: [PATCH] Add `LastUserMessage` field to the `Chat` struct --- v1/types.go | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/v1/types.go b/v1/types.go index a627271..d93cd5a 100644 --- a/v1/types.go +++ b/v1/types.go @@ -344,16 +344,17 @@ type ( } ChatResponseItem struct { - ID uint64 `json:"id"` - Avatar string `json:"avatar"` - Name string `json:"name"` - Channel Channel `json:"channel,omitempty"` - Customer UserRef `json:"customer"` - AuthorID uint64 `json:"author_id"` - LastMessage Message `json:"last_message"` - LastActivity string `json:"last_activity"` - CreatedAt string `json:"created_at"` - UpdatedAt string `json:"updated_at"` + ID uint64 `json:"id"` + Avatar string `json:"avatar"` + Name string `json:"name"` + Channel Channel `json:"channel,omitempty"` + Customer UserRef `json:"customer"` + AuthorID uint64 `json:"author_id"` + LastMessage Message `json:"last_message"` + LastUserMessage MessageID `json:"last_user_message"` + LastActivity string `json:"last_activity"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` } MemberResponseItem struct { @@ -470,6 +471,10 @@ type ( *AttachmentList } + MessageID struct { + ID uint64 `json:"id"` + } + TextMessage struct { Content string `json:"content"` Quote *QuoteMessage `json:"quote"` @@ -623,15 +628,16 @@ type ( } Chat struct { - ID uint64 `json:"id"` - Avatar string `json:"avatar"` - Name string `json:"name"` - Channel *Channel `json:"channel,omitempty"` - Members []Member `json:"members"` - Customer *UserRef `json:"customer"` - AuthorID uint64 `json:"author_id"` - LastMessage *Message `json:"last_message"` - LastActivity string `json:"last_activity"` + ID uint64 `json:"id"` + Avatar string `json:"avatar"` + Name string `json:"name"` + Channel *Channel `json:"channel,omitempty"` + Members []Member `json:"members"` + Customer *UserRef `json:"customer"` + AuthorID uint64 `json:"author_id"` + LastMessage *Message `json:"last_message"` + LastUserMessage *MessageID `json:"last_user_message"` + LastActivity string `json:"last_activity"` } WaitingChat struct {