status-go/protocol/push_notification_server/push_notification_server.go

33 lines
769 B
Go
Raw Normal View History

package protocol
import (
"crypto/ecdsa"
"errors"
"github.com/status-im/status-go/protocol/protobuf"
)
var ErrEmptyPushNotificationRegisterMessage = errors.New("empty PushNotificationRegisterMessage")
type Config struct {
// Identity is our identity key
Identity *ecdsa.PrivateKey
// GorushUrl is the url for the gorush service
GorushURL string
}
type Server struct {
persistence *Persistence
config *Config
}
func New(persistence *Persistence) *Server {
return &Server{persistence: persistence}
}
func (p *Server) ValidateRegistration(previousRegistration *protobuf.PushNotificationRegister, newRegistration *protobuf.PushNotificationRegister) error {
if newRegistration == nil {
return ErrEmptyPushNotificationRegisterMessage
}
return nil
}