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