diff --git a/notification.go b/notification.go index 0f46ae68..2e596908 100644 --- a/notification.go +++ b/notification.go @@ -9,6 +9,7 @@ package whatsmeow import ( "encoding/json" "errors" + "time" "google.golang.org/protobuf/proto" @@ -274,6 +275,8 @@ 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 511216c4..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" @@ -148,6 +149,8 @@ type NewsletterText struct { type NewsletterMessage struct { MessageServerID MessageServerID + MessageID MessageID + TimeStamp time.Time ViewsCount int ReactionCounts map[string]int