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 eed3212 commit e0cc8cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions protocol/communities/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,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 @@ -2031,6 +2032,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
}
}

dbRequest.State = RequestToJoinStateAccepted
if err := m.markRequestToJoin(pk, community); err != nil {
return nil, err
}
Expand Down Expand Up @@ -2058,6 +2060,8 @@ func (m *Manager) DeclineRequestToJoin(dbRequest *RequestToJoin) (*Community, er
if community.HasPermissionToSendCommunityEvents() {
requestToJoinState = RequestToJoinStateDeclinedPending
}

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

0 comments on commit e0cc8cc

Please sign in to comment.