diff --git a/notification.go b/notification.go index 1b04a96c..2e596908 100644 --- a/notification.go +++ b/notification.go @@ -9,6 +9,7 @@ package whatsmeow import ( "encoding/json" "errors" + "time" "google.golang.org/protobuf/proto" @@ -275,6 +276,7 @@ func (cli *Client) parseNewsletterMessages(node *waBinary.Node) []*types.Newslet msg := types.NewsletterMessage{ MessageServerID: child.AttrGetter().Int("server_id"), MessageID: child.AttrGetter().String("id"), + TimeStamp: time.Unix(child.AttrGetter().Int64("t"), 0), ViewsCount: 0, ReactionCounts: nil, } diff --git a/types/newsletter.go b/types/newsletter.go index b4dba1e1..68c1da12 100644 --- a/types/newsletter.go +++ b/types/newsletter.go @@ -10,6 +10,7 @@ import ( "bytes" "encoding/json" "fmt" + "time" "go.mau.fi/util/jsontime" @@ -149,6 +150,7 @@ type NewsletterText struct { type NewsletterMessage struct { MessageServerID MessageServerID MessageID MessageID + TimeStamp time.Time ViewsCount int ReactionCounts map[string]int