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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
8bb4192c
Commit
8bb4192c
authored
May 14, 2020
by
Niamh Nikali
Browse files
Options
Downloads
Patches
Plain Diff
Put sender ID in keyfp field into valid ID when receiving
parent
18ab679f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
io/receive.go
+12
-1
12 additions, 1 deletion
io/receive.go
with
12 additions
and
1 deletion
io/receive.go
+
12
−
1
View file @
8bb4192c
...
...
@@ -278,7 +278,7 @@ func (rm *ReceptionManager) decryptMessages(session user.Session,
}
keyFP
:=
msg
.
AssociatedData
.
GetKeyFP
()
sender
,
err
=
id
.
Unmarshal
(
keyFP
[
:
])
sender
,
err
=
makeUserID
(
keyFP
[
:
])
}
else
{
sender
,
rekey
,
err
=
handleE2EReceiving
(
session
,
msg
)
...
...
@@ -314,6 +314,17 @@ func broadcastMessageReception(message *parse.Message,
listeners
.
Speak
(
message
)
}
// Put a sender ID in a byte slice and set its type to user
func
makeUserID
(
senderID
[]
byte
)
(
*
id
.
ID
,
error
)
{
senderIDBytes
:=
make
([]
byte
,
id
.
ArrIDLen
)
copy
(
senderIDBytes
,
senderID
[
:
])
userID
,
err
:=
id
.
Unmarshal
(
senderIDBytes
)
if
userID
!=
nil
{
userID
.
SetType
(
id
.
User
)
}
return
userID
,
err
}
// skipErrChecker checks checks if the error is fatal or should be ignored
func
skipErrChecker
(
err
error
)
bool
{
if
strings
.
Contains
(
err
.
Error
(),
"Could not find any message IDs for this user"
)
{
...
...
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