Skip to content
Snippets Groups Projects
Commit b0bfd5fe authored by Jake Taylor's avatar Jake Taylor
Browse files

cleanup

parent 63d977da
No related branches found
No related tags found
4 merge requests!510Release,!207WIP: Client Restructure,!203Symmetric broadcast,!194refactor send group chat code
......@@ -56,7 +56,7 @@ func (l *requestListener) Name() string {
return catalog.GroupRq
}
// readRequest returns the group describes in the group request message. An
// readRequest returns the group described 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
......
......@@ -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.GetGroup(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 roundIdMap2List(roundIDs), PartialSent,
return roundList, 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 roundIdMap2List(roundIDs), AllSent, nil
return roundList, AllSent, nil
}
// sendRequest sends the group request to the user via E2E.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment