Skip to content

Commit

Permalink
add TimeStamp on NewsletterMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
RomySaputraSihananda committed Dec 10, 2024
1 parent cb82abd commit 160270b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package whatsmeow
import (
"encoding/json"
"errors"
"time"

"google.golang.org/protobuf/proto"

Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 2 additions & 0 deletions types/newsletter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"time"

"go.mau.fi/util/jsontime"

Expand Down Expand Up @@ -149,6 +150,7 @@ type NewsletterText struct {
type NewsletterMessage struct {
MessageServerID MessageServerID
MessageID MessageID
TimeStamp time.Time
ViewsCount int
ReactionCounts map[string]int

Expand Down

0 comments on commit 160270b

Please sign in to comment.