Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
fbe4d604
Commit
fbe4d604
authored
4 years ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
remove auth from nb host
parent
a5ac96b1
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/client.go
+3
-1
3 additions, 1 deletion
api/client.go
bindings/notifications.go
+3
-3
3 additions, 3 deletions
bindings/notifications.go
with
6 additions
and
4 deletions
api/client.go
+
3
−
1
View file @
fbe4d604
...
...
@@ -228,7 +228,9 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie
}
if
def
.
Notification
.
Address
!=
""
{
_
,
err
=
c
.
comms
.
AddHost
(
&
id
.
NotificationBot
,
def
.
Notification
.
Address
,
[]
byte
(
def
.
Notification
.
TlsCertificate
),
connect
.
GetDefaultHostParams
())
hp
:=
connect
.
GetDefaultHostParams
()
hp
.
AuthEnabled
=
false
_
,
err
=
c
.
comms
.
AddHost
(
&
id
.
NotificationBot
,
def
.
Notification
.
Address
,
[]
byte
(
def
.
Notification
.
TlsCertificate
),
hp
)
if
err
!=
nil
{
jww
.
WARN
.
Printf
(
"Failed adding host for notifications: %+v"
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
bindings/notifications.go
+
3
−
3
View file @
fbe4d604
...
...
@@ -14,7 +14,7 @@ import (
"gitlab.com/xx_network/primitives/id"
)
// Check if a notification received is for me
//
NotificationForMe
Check if a notification received is for me
func
NotificationForMe
(
messageHash
,
idFP
string
,
receptionId
[]
byte
)
(
bool
,
error
)
{
messageHashBytes
,
err
:=
base64
.
StdEncoding
.
DecodeString
(
messageHash
)
if
err
!=
nil
{
...
...
@@ -31,12 +31,12 @@ func NotificationForMe(messageHash, idFP string, receptionId []byte) (bool, erro
return
fingerprint
.
CheckIdentityFpFromMessageHash
(
idFpBytes
,
messageHashBytes
,
rid
),
nil
}
// Register
for n
otifications
,
accepts firebase messaging token
// Register
ForN
otifications accepts firebase messaging token
func
(
c
*
Client
)
RegisterForNotifications
(
token
[]
byte
)
error
{
return
c
.
api
.
RegisterForNotifications
(
token
)
}
// Unregister for notifications
// Unregister
ForNotifications unregister user
for notifications
func
(
c
*
Client
)
UnregisterForNotifications
()
error
{
return
c
.
api
.
UnregisterForNotifications
()
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment