From cf0a16dff15c327a34074d0e6ceae4ded52f73e5 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Mon, 25 Jan 2021 12:07:10 +0100 Subject: [PATCH] Revert "fix protocol.MessageNotificationBody marshalling" This reverts commit fbec17af18678ae14afa89d1fd5a59f635203646. --- protocol/local_notifications.go | 6 +++--- services/local-notifications/core.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/protocol/local_notifications.go b/protocol/local_notifications.go index 94e32d464..fdb859191 100644 --- a/protocol/local_notifications.go +++ b/protocol/local_notifications.go @@ -3,7 +3,7 @@ package protocol import "github.com/status-im/status-go/protocol/common" type MessageNotificationBody struct { - Message *common.Message `json:"message"` - Contact *Contact `json:"contact"` - Chat *Chat `json:"chat"` + Message *common.Message + Contact *Contact + Chat *Chat } diff --git a/services/local-notifications/core.go b/services/local-notifications/core.go index d9138b987..5390a3218 100644 --- a/services/local-notifications/core.go +++ b/services/local-notifications/core.go @@ -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, }