chore: don't process request to join if admin and community is set to

auto-accept
This commit is contained in:
Pascal Precht 2023-07-31 10:11:40 +02:00 committed by r4bbit
parent d5203c5e53
commit 75cd002863
1 changed files with 5 additions and 0 deletions

View File

@ -1752,6 +1752,11 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, request
return nil, ErrOrgNotFound
}
// don't process request as admin if community is configured as auto-accept
if community.HasPermissionToSendCommunityEvents() && community.AcceptRequestToJoinAutomatically() {
return nil, errors.New("ignoring request to join, community is set to auto-accept")
}
isUserRejected, err := m.isUserRejectedFromCommunity(signer, community, request.Clock)
if err != nil {
return nil, err