Skip to content
Snippets Groups Projects
Commit 5923e8c8 authored by Jonah Husson's avatar Jonah Husson
Browse files

unregister shouldn't take in token and can get uid from auth context

parent 8aca2b4b
No related branches found
No related tags found
No related merge requests found
......@@ -623,7 +623,7 @@ func (cl *Client) RegisterForNotifications(notificationToken []byte) error {
// UnregisterForNotifications sends a message to notification bot indicating it
// no longer wants to be registered for notifications
func (cl *Client) UnregisterForNotifications(notificationToken []byte) error {
func (cl *Client) UnregisterForNotifications() error {
// Pull the host from the manage
notificationBotHost, ok := cl.receptionManager.Comms.GetHost(id.NOTIFICATION_BOT)
if !ok {
......@@ -631,10 +631,7 @@ func (cl *Client) UnregisterForNotifications(notificationToken []byte) error {
}
// Send the unregister message
_, err := cl.receptionManager.Comms.UnregisterForNotifications(notificationBotHost,
&mixmessages.NotificationToken{
Token: notificationToken,
})
_, err := cl.receptionManager.Comms.UnregisterForNotifications(notificationBotHost)
if err != nil {
err := errors.Errorf(
"RegisterForNotifications: Unable to register for notifications! %s", err)
......
......@@ -601,9 +601,7 @@ func TestClient_UnregisterForNotifications(t *testing.T) {
t.Errorf("Client failed of connect: %+v", err)
}
token := make([]byte, 32)
err = client.UnregisterForNotifications(token)
err = client.UnregisterForNotifications()
if err != nil {
t.Errorf("Expected happy path, received error: %+v", err)
}
......
......@@ -455,6 +455,6 @@ func (cl *Client) RegisterForNotifications(notificationToken []byte) error {
// UnregisterForNotifications sends a message to notification bot indicating it
// no longer wants to be registered for notifications
func (cl *Client) UnregisterForNotifications(notificationToken []byte) error {
return cl.client.UnregisterForNotifications(notificationToken)
func (cl *Client) UnregisterForNotifications() error {
return cl.client.UnregisterForNotifications()
}
......@@ -16,10 +16,9 @@ require (
github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.6.2
gitlab.com/elixxir/comms v0.0.0-20200204192930-8fd476a64468
gitlab.com/elixxir/comms v0.0.0-20200206234845-5888084a9a0c
gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23
gitlab.com/elixxir/primitives v0.0.0-20200204190335-4d9fa02de847
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72
google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67 // indirect
golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a
gopkg.in/ini.v1 v1.52.0 // indirect
)
......@@ -149,8 +149,8 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
gitlab.com/elixxir/comms v0.0.0-20200204192930-8fd476a64468 h1:yx5qVE5/gB3TbAHUaPmEKigvzJdupVlBwcYPJ9Nsjjw=
gitlab.com/elixxir/comms v0.0.0-20200204192930-8fd476a64468/go.mod h1:Sj8zkWG1FTP4siUzLZOhQUc0G7qwHa7QNz1iXP/OKIg=
gitlab.com/elixxir/comms v0.0.0-20200206234845-5888084a9a0c h1:6Bp6uTmqD4z4kOR2PEk/HPGwhzai0unJtApiVBbQolg=
gitlab.com/elixxir/comms v0.0.0-20200206234845-5888084a9a0c/go.mod h1:maK5To73lT8L8ygCoNsFUj+b1gRfYk45w8IxiO6Y6HA=
gitlab.com/elixxir/crypto v0.0.0-20200108005412-8159c60663f9 h1:MJ87g3yMIvA9MTDMojuqaw1tCxU6LIKzxMaH3oEiP4M=
gitlab.com/elixxir/crypto v0.0.0-20200108005412-8159c60663f9/go.mod h1:+46Zj/NE6JEkXExYnzdvvDokPpDbA+fJsRszvrezK9k=
gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23 h1:J9MKdOxLGzDZoLy2Q0CAxPlPjSH+k4NG3JhgvatAZjo=
......@@ -173,6 +173,8 @@ golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72 h1:+ELyKg6m8UBf0nPFSqD0mi7zUfwPyXo23HNjMnXPz7w=
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a h1:aczoJ0HPNE92XKa7DrIzkNN6esOKO2TBwiiYoKcINhA=
golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
......@@ -222,7 +224,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67 h1:MBO9fkVSrTpJ8vgHLPi5gb+ZWXEy7/auJN8yqyu9EiE=
google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
......@@ -233,6 +234,8 @@ google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment