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
b0bfd5fe
Commit
b0bfd5fe
authored
3 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
63d977da
No related branches found
No related tags found
4 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
,
!194
refactor send group chat code
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
groupChat/receiveRequest.go
+1
-1
1 addition, 1 deletion
groupChat/receiveRequest.go
groupChat/sendRequests.go
+6
-3
6 additions, 3 deletions
groupChat/sendRequests.go
with
7 additions
and
4 deletions
groupChat/receiveRequest.go
+
1
−
1
View file @
b0bfd5fe
...
...
@@ -56,7 +56,7 @@ func (l *requestListener) Name() string {
return
catalog
.
GroupRq
}
// readRequest returns the group describe
s
in the group request message. An
// readRequest returns the group describe
d
in the group request message. An
// error is returned if the request is of the wrong type or cannot be read.
func
(
m
*
Manager
)
readRequest
(
msg
receive
.
Message
)
(
gs
.
Group
,
error
)
{
// Return an error if the message is not of the right type
...
...
This diff is collapsed.
Click to expand it.
groupChat/sendRequests.go
+
6
−
3
View file @
b0bfd5fe
...
...
@@ -30,7 +30,7 @@ const (
// ResendRequest allows a groupChat request to be sent again.
func
(
m
Manager
)
ResendRequest
(
groupID
*
id
.
ID
)
([]
id
.
Round
,
RequestStatus
,
error
)
{
g
,
exists
:=
m
.
gs
.
Get
(
groupID
)
g
,
exists
:=
m
.
Get
Group
(
groupID
)
if
!
exists
{
return
nil
,
NotSent
,
errors
.
Errorf
(
resendGroupIdErr
,
groupID
)
}
...
...
@@ -94,10 +94,13 @@ func (m Manager) sendRequests(g gs.Group) ([]id.Round, RequestStatus, error) {
errors
.
Errorf
(
sendRequestAllErr
,
len
(
errs
),
strings
.
Join
(
errs
,
"
\n
"
))
}
// Convert roundIdMap to List
roundList
:=
roundIdMap2List
(
roundIDs
)
// If some sends returned an error, then return a list of round IDs for the
// successful sends and a list of errors for the failed ones
if
len
(
errs
)
>
0
{
return
round
IdMap2List
(
roundIDs
)
,
PartialSent
,
return
round
List
,
PartialSent
,
errors
.
Errorf
(
sendRequestPartialErr
,
len
(
errs
),
n
,
strings
.
Join
(
errs
,
"
\n
"
))
}
...
...
@@ -106,7 +109,7 @@ func (m Manager) sendRequests(g gs.Group) ([]id.Round, RequestStatus, error) {
len
(
g
.
Members
),
g
.
Name
,
g
.
ID
)
// If all sends succeeded, return a list of roundIDs
return
round
IdMap2List
(
roundIDs
)
,
AllSent
,
nil
return
round
List
,
AllSent
,
nil
}
// sendRequest sends the group request to the user via E2E.
...
...
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