fix protocol.MessageNotificationBody marshalling
This commit is contained in:
parent
b5b1e19c24
commit
fbec17af18
|
@ -3,7 +3,7 @@ package protocol
|
|||
import "github.com/status-im/status-go/protocol/common"
|
||||
|
||||
type MessageNotificationBody struct {
|
||||
Message *common.Message
|
||||
Contact *Contact
|
||||
Chat *Chat
|
||||
Message *common.Message `json:"message"`
|
||||
Contact *Contact `json:"contact"`
|
||||
Chat *Chat `json:"chat"`
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ func (n *Notification) MarshalJSON() ([]byte, error) {
|
|||
|
||||
switch n.BodyType {
|
||||
case TypeTransaction:
|
||||
if nb, ok := n.Body.(*notificationBody); ok {
|
||||
if nb, ok := n.Body.(notificationBody); ok {
|
||||
body, err = json.Marshal(nb)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -147,7 +147,7 @@ func (n *Notification) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
|
||||
case TypeMessage:
|
||||
if nmb, ok := n.Body.(*protocol.MessageNotificationBody); ok {
|
||||
if nmb, ok := n.Body.(protocol.MessageNotificationBody); ok {
|
||||
body, err = json.Marshal(nmb)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -273,7 +273,7 @@ func (s *Service) buildTransactionNotification(rawTransfer wallet.Transfer) *Not
|
|||
return &Notification{
|
||||
BodyType: TypeTransaction,
|
||||
ID: transfer.ID,
|
||||
Body: &body,
|
||||
Body: body,
|
||||
Deeplink: deeplink,
|
||||
Category: CategoryTransaction,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue