From dc3ae771646512576ac29dcd9e9de05a431a533f Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Thu, 13 Jul 2023 19:49:19 +0200 Subject: [PATCH] feat: add CommunityEncryptionKeyActions and its evaluation logic Added utility that evaluates necessary encryption key actions based on community changes. part of: status-im/status-desktop#10998 --- protocol/communities/community.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/communities/community.go b/protocol/communities/community.go index 81600ef53c4..f734a812538 100644 --- a/protocol/communities/community.go +++ b/protocol/communities/community.go @@ -1697,6 +1697,9 @@ func (o *Community) RequestsToJoin() []*RequestToJoin { } func (o *Community) AddMember(publicKey *ecdsa.PublicKey, roles []protobuf.CommunityMember_Roles) (*CommunityChanges, error) { + o.mutex.Lock() + defer o.mutex.Unlock() + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin }