Send pubkey instead of address to PNBroadcastAvailabilityRequest

This commit is contained in:
Adrià Cidre 2018-05-04 10:01:42 +02:00
parent ca2bf9faec
commit e1c81b6cc6
No known key found for this signature in database
GPG Key ID: D246A27D58A92CAB
2 changed files with 6 additions and 1 deletions

View File

@ -141,7 +141,7 @@ func (c *Channel) SendPostRawMsg(body string) error {
// push notification server Public Key.
func (c *Channel) PNBroadcastAvailabilityRequest() {
format := `["%s",["%s"]]`
msg := fmt.Sprintf(format, PNBroadcastAvailabilityType, c.conn.address)
msg := fmt.Sprintf(format, PNBroadcastAvailabilityType, c.conn.pubkey)
c.SendPostRawMsg(msg)
}

5
sdk.go
View File

@ -10,6 +10,8 @@ import (
type SDK struct {
RPCClient RPCClient
address string
pubkey string
mnemonic string
userName string
channels []*Channel
minimumPoW float64
@ -47,6 +49,9 @@ func (c *SDK) Signup(pwd string) (addr string, pubkey string, mnemonic string, e
if err != nil {
return "", "", "", err
}
c.address = res.Result.Address
c.pubkey = res.Result.Pubkey
c.mnemonic = res.Result.Mnemonic
return res.Result.Address, res.Result.Pubkey, res.Result.Mnemonic, err
}