Skip to content

Commit

Permalink
fix(communities): set state correctly on request accept or decline
Browse files Browse the repository at this point in the history
  • Loading branch information
jrainville committed Oct 11, 2023
1 parent 1fedf55 commit 0838603
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protocol/communities/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
}
}

dbRequest.State = RequestToJoinStateAccepted
if err := m.markRequestToJoinAsAccepted(pk, community); err != nil {
return nil, err
}
Expand Down Expand Up @@ -2022,6 +2023,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
return nil, err
}

dbRequest.State = RequestToJoinStateAcceptedPending
if err := m.markRequestToJoinAsAcceptedPending(pk, community); err != nil {
return nil, err
}
Expand Down Expand Up @@ -2057,6 +2059,7 @@ func (m *Manager) DeclineRequestToJoin(dbRequest *RequestToJoin) (*Community, er
requestToJoinState = RequestToJoinStateDeclinedPending // can only be declined by control node
}

dbRequest.State = requestToJoinState
err = m.persistence.SetRequestToJoinState(dbRequest.PublicKey, dbRequest.CommunityID, requestToJoinState)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0838603

Please sign in to comment.