diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index 67ba7f45a..5235d1cf9 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -4370,15 +4370,21 @@ func (m *Messenger) CheckCommunityChannelPermissions(request *requests.CheckComm return nil, err } - accounts, err := m.settings.GetActiveAccounts() - if err != nil { - return nil, err - } - var addresses []gethcommon.Address - for _, a := range accounts { - addresses = append(addresses, gethcommon.HexToAddress(a.Address.Hex())) + if len(request.Addresses) == 0 { + accounts, err := m.settings.GetActiveAccounts() + if err != nil { + return nil, err + } + + for _, a := range accounts { + addresses = append(addresses, gethcommon.HexToAddress(a.Address.Hex())) + } + } else { + for _, v := range request.Addresses { + addresses = append(addresses, gethcommon.HexToAddress(v)) + } } return m.communitiesManager.CheckChannelPermissions(request.CommunityID, request.ChatID, addresses) @@ -4389,15 +4395,21 @@ func (m *Messenger) CheckAllCommunityChannelsPermissions(request *requests.Check return nil, err } - accounts, err := m.settings.GetActiveAccounts() - if err != nil { - return nil, err - } - var addresses []gethcommon.Address - for _, a := range accounts { - addresses = append(addresses, gethcommon.HexToAddress(a.Address.Hex())) + if len(request.Addresses) == 0 { + accounts, err := m.settings.GetActiveAccounts() + if err != nil { + return nil, err + } + + for _, a := range accounts { + addresses = append(addresses, gethcommon.HexToAddress(a.Address.Hex())) + } + } else { + for _, v := range request.Addresses { + addresses = append(addresses, gethcommon.HexToAddress(v)) + } } return m.communitiesManager.CheckAllChannelsPermissions(request.CommunityID, addresses) diff --git a/protocol/requests/check_all_community_channels_permissions.go b/protocol/requests/check_all_community_channels_permissions.go index a811f6ae2..2c727af06 100644 --- a/protocol/requests/check_all_community_channels_permissions.go +++ b/protocol/requests/check_all_community_channels_permissions.go @@ -12,6 +12,7 @@ var ( type CheckAllCommunityChannelsPermissions struct { CommunityID types.HexBytes + Addresses []string `json:"addresses"` } func (u *CheckAllCommunityChannelsPermissions) Validate() error { diff --git a/protocol/requests/check_community_channel_permissions.go b/protocol/requests/check_community_channel_permissions.go index 58dde2d41..58be4bad9 100644 --- a/protocol/requests/check_community_channel_permissions.go +++ b/protocol/requests/check_community_channel_permissions.go @@ -14,6 +14,7 @@ var ( type CheckCommunityChannelPermissions struct { CommunityID types.HexBytes ChatID string + Addresses []string `json:"addresses"` } func (u *CheckCommunityChannelPermissions) Validate() error {