feature: profile showcase preferences sync&backup (#4729)

This commit is contained in:
Igor Sirotin 2024-02-17 18:07:20 +00:00 committed by GitHub
parent f0e6fd31de
commit 85c0e282ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 1988 additions and 767 deletions

View File

@ -63,6 +63,7 @@ type ProfileShowcaseUnverifiedTokenPreference struct {
}
type ProfileShowcasePreferences struct {
Clock uint64 `json:"clock"`
Communities []*ProfileShowcaseCommunityPreference `json:"communities"`
Accounts []*ProfileShowcaseAccountPreference `json:"accounts"`
Collectibles []*ProfileShowcaseCollectiblePreference `json:"collectibles"`

View File

@ -2835,7 +2835,17 @@ func (m *Messenger) SyncDevices(ctx context.Context, ensName, photoPath string,
return err
}
return m.syncSocialLinks(context.Background(), rawMessageHandler)
err = m.syncSocialLinks(context.Background(), rawMessageHandler)
if err != nil {
return err
}
err = m.syncProfileShowcasePreferences(context.Background(), rawMessageHandler)
if err != nil {
return err
}
return nil
}
func (m *Messenger) syncContactRequestDecision(ctx context.Context, requestID string, accepted bool, rawMessageHandler RawMessageHandler) error {

View File

@ -475,6 +475,11 @@ func (m *Messenger) backupProfile(ctx context.Context, clock uint64) ([]*protobu
}
}
profileShowcasePreferences, err := m.GetProfileShowcasePreferences()
if err != nil {
return nil, err
}
backupMessage := &protobuf.Backup{
Profile: &protobuf.BackedUpProfile{
KeyUid: keyUID,
@ -483,6 +488,7 @@ func (m *Messenger) backupProfile(ctx context.Context, clock uint64) ([]*protobu
DisplayNameClock: displayNameClock,
SocialLinks: syncSocialLinks,
EnsUsernameDetails: ensUsernameDetailProtos,
ProfileShowcasePreferences: ToProfileShowcasePreferencesProto(profileShowcasePreferences),
},
}

View File

@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"reflect"
"testing"
"github.com/status-im/status-go/protocol/identity"
@ -157,6 +158,10 @@ func (s *MessengerBackupSuite) TestBackupProfile() {
})
s.Require().NoError(err)
profileShowcasePreferences := DummyProfileShowcasePreferences()
err = bob1.SetProfileShowcasePreferences(profileShowcasePreferences, false)
s.Require().NoError(err)
// Create bob2
bob2, err := newMessengerWithKey(s.shh, bob1.identity, s.logger, nil)
s.Require().NoError(err)
@ -187,6 +192,13 @@ func (s *MessengerBackupSuite) TestBackupProfile() {
s.Require().NoError(err)
s.Require().Equal(1, len(bob1EnsUsernameDetails))
bob1ProfileShowcasePreferences, err := bob1.GetProfileShowcasePreferences()
s.Require().NoError(err)
s.Require().NotNil(bob1ProfileShowcasePreferences)
s.Require().Greater(bob1ProfileShowcasePreferences.Clock, uint64(0))
profileShowcasePreferences.Clock = bob1ProfileShowcasePreferences.Clock // override clock for simpler comparison
s.Require().True(reflect.DeepEqual(profileShowcasePreferences, bob1ProfileShowcasePreferences))
// Check bob2
storedBob2DisplayName, err := bob2.settings.DisplayName()
s.Require().NoError(err)
@ -209,6 +221,16 @@ func (s *MessengerBackupSuite) TestBackupProfile() {
s.Require().NoError(err)
s.Require().Equal(0, len(bob2EnsUsernameDetails))
bob2ProfileShowcasePreferences, err := bob2.GetProfileShowcasePreferences()
s.Require().NoError(err)
s.Require().NotNil(bob2ProfileShowcasePreferences)
s.Require().Equal(uint64(0), bob2ProfileShowcasePreferences.Clock)
s.Require().Len(bob2ProfileShowcasePreferences.Communities, 0)
s.Require().Len(bob2ProfileShowcasePreferences.Accounts, 0)
s.Require().Len(bob2ProfileShowcasePreferences.Collectibles, 0)
s.Require().Len(bob2ProfileShowcasePreferences.VerifiedTokens, 0)
s.Require().Len(bob2ProfileShowcasePreferences.UnverifiedTokens, 0)
// Backup
clock, err := bob1.BackupData(context.Background())
s.Require().NoError(err)
@ -248,6 +270,10 @@ func (s *MessengerBackupSuite) TestBackupProfile() {
s.Require().Equal(1, len(bob2EnsUsernameDetails))
s.Require().Equal(bob1EnsUsernameDetail, bob2EnsUsernameDetails[0])
bob2ProfileShowcasePreferences, err = bob1.GetProfileShowcasePreferences()
s.Require().NoError(err)
s.Require().True(reflect.DeepEqual(bob1ProfileShowcasePreferences, bob2ProfileShowcasePreferences))
lastBackup, err := bob1.lastBackup()
s.Require().NoError(err)
s.Require().NotEmpty(lastBackup)

View File

@ -3895,3 +3895,7 @@ func (m *Messenger) addNewKeypairAddedOnPairedDeviceACNotification(keyUID string
}
return nil
}
func (m *Messenger) HandleSyncProfileShowcasePreferences(state *ReceivedMessageState, p *protobuf.SyncProfileShowcasePreferences, msg *v1protocol.StatusMessage) error {
return m.saveProfileShowcasePreferencesProto(p, false)
}

View File

@ -244,6 +244,9 @@ func (m *Messenger) dispatchToHandler(messageState *ReceivedMessageState, protoB
case protobuf.ApplicationMetadataMessage_COMMUNITY_USER_KICKED:
return m.handleCommunityUserKickedProtobuf(messageState, protoBytes, msg, filter)
case protobuf.ApplicationMetadataMessage_SYNC_PROFILE_SHOWCASE_PREFERENCES:
return m.handleSyncProfileShowcasePreferencesProtobuf(messageState, protoBytes, msg, filter)
default:
m.logger.Info("protobuf type not found", zap.String("type", string(msg.ApplicationLayer.Type)))
return errors.New("protobuf type not found")
@ -1749,3 +1752,26 @@ func (m *Messenger) handleCommunityUserKickedProtobuf(messageState *ReceivedMess
}
func (m *Messenger) handleSyncProfileShowcasePreferencesProtobuf(messageState *ReceivedMessageState, protoBytes []byte, msg *v1protocol.StatusMessage, filter transport.Filter) error {
m.logger.Info("handling SyncProfileShowcasePreferences")
if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) {
m.logger.Warn("not coming from us, ignoring")
return nil
}
p := &protobuf.SyncProfileShowcasePreferences{}
err := proto.Unmarshal(protoBytes, p)
if err != nil {
return err
}
m.outputToCSV(msg.TransportLayer.Message.Timestamp, msg.ApplicationLayer.ID, messageState.CurrentMessageState.Contact.ID, filter.ContentTopic, filter.ChatID, msg.ApplicationLayer.Type, p)
return m.HandleSyncProfileShowcasePreferences(messageState, p, msg)
}

View File

@ -2,6 +2,7 @@ package protocol
import (
"bytes"
"context"
"crypto/ecdsa"
crand "crypto/rand"
"errors"
@ -217,7 +218,13 @@ func (m *Messenger) fromProfileShowcaseUnverifiedTokenProto(messages []*protobuf
return entries
}
func (m *Messenger) SetProfileShowcasePreferences(preferences *identity.ProfileShowcasePreferences) error {
func (m *Messenger) SetProfileShowcasePreferences(preferences *identity.ProfileShowcasePreferences, sync bool) error {
clock, _ := m.getLastClockWithRelatedChat()
preferences.Clock = clock
return m.setProfileShowcasePreferences(preferences, sync)
}
func (m *Messenger) setProfileShowcasePreferences(preferences *identity.ProfileShowcasePreferences, sync bool) error {
err := identity.Validate(preferences)
if err != nil {
return err
@ -228,11 +235,22 @@ func (m *Messenger) SetProfileShowcasePreferences(preferences *identity.ProfileS
return err
}
if sync {
err = m.syncProfileShowcasePreferences(context.Background(), m.dispatchMessage)
if err != nil {
return err
}
}
return m.DispatchProfileShowcase()
}
func (m *Messenger) DispatchProfileShowcase() error {
return m.publishContactCode()
err := m.publishContactCode()
if err != nil {
return err
}
return nil
}
func (m *Messenger) GetProfileShowcasePreferences() (*identity.ProfileShowcasePreferences, error) {
@ -544,3 +562,32 @@ func (m *Messenger) DeleteProfileShowcaseCommunity(community *communities.Commun
}
return nil
}
func (m *Messenger) saveProfileShowcasePreferencesProto(p *protobuf.SyncProfileShowcasePreferences, shouldSync bool) error {
preferences := FromProfileShowcasePreferencesProto(p)
return m.setProfileShowcasePreferences(preferences, shouldSync)
}
func (m *Messenger) syncProfileShowcasePreferences(ctx context.Context, rawMessageHandler RawMessageHandler) error {
preferences, err := m.GetProfileShowcasePreferences()
if err != nil {
return err
}
syncMessage := ToProfileShowcasePreferencesProto(preferences)
encodedMessage, err := proto.Marshal(syncMessage)
if err != nil {
return err
}
_, chat := m.getLastClockWithRelatedChat()
rawMessage := common.RawMessage{
LocalChatID: chat.ID,
Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_SYNC_PROFILE_SHOWCASE_PREFERENCES,
ResendAutomatically: true,
}
_, err = rawMessageHandler(ctx, rawMessage)
return err
}

View File

@ -0,0 +1,207 @@
package protocol
import (
"github.com/status-im/status-go/protocol/identity"
"github.com/status-im/status-go/protocol/protobuf"
)
func FromProfileShowcaseCommunityPreferenceProto(p *protobuf.ProfileShowcaseCommunityPreference) *identity.ProfileShowcaseCommunityPreference {
return &identity.ProfileShowcaseCommunityPreference{
CommunityID: p.GetCommunityId(),
ShowcaseVisibility: identity.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int(p.Order),
}
}
func FromProfileShowcaseCommunitiesPreferencesProto(preferences []*protobuf.ProfileShowcaseCommunityPreference) []*identity.ProfileShowcaseCommunityPreference {
out := make([]*identity.ProfileShowcaseCommunityPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, FromProfileShowcaseCommunityPreferenceProto(p))
}
return out
}
func ToProfileShowcaseCommunityPreferenceProto(p *identity.ProfileShowcaseCommunityPreference) *protobuf.ProfileShowcaseCommunityPreference {
return &protobuf.ProfileShowcaseCommunityPreference{
CommunityId: p.CommunityID,
ShowcaseVisibility: protobuf.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int32(p.Order),
}
}
func ToProfileShowcaseCommunitiesPreferencesProto(preferences []*identity.ProfileShowcaseCommunityPreference) []*protobuf.ProfileShowcaseCommunityPreference {
out := make([]*protobuf.ProfileShowcaseCommunityPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, ToProfileShowcaseCommunityPreferenceProto(p))
}
return out
}
func FromProfileShowcaseAccountPreferenceProto(p *protobuf.ProfileShowcaseAccountPreference) *identity.ProfileShowcaseAccountPreference {
return &identity.ProfileShowcaseAccountPreference{
Address: p.GetAddress(),
Name: p.GetName(),
ColorID: p.GetColorId(),
Emoji: p.GetEmoji(),
ShowcaseVisibility: identity.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int(p.Order),
}
}
func FromProfileShowcaseAccountsPreferencesProto(preferences []*protobuf.ProfileShowcaseAccountPreference) []*identity.ProfileShowcaseAccountPreference {
out := make([]*identity.ProfileShowcaseAccountPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, FromProfileShowcaseAccountPreferenceProto(p))
}
return out
}
func ToProfileShowcaseAccountPreferenceProto(p *identity.ProfileShowcaseAccountPreference) *protobuf.ProfileShowcaseAccountPreference {
return &protobuf.ProfileShowcaseAccountPreference{
Address: p.Address,
Name: p.Name,
ColorId: p.ColorID,
Emoji: p.Emoji,
ShowcaseVisibility: protobuf.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int32(p.Order),
}
}
func ToProfileShowcaseAccountsPreferenceProto(preferences []*identity.ProfileShowcaseAccountPreference) []*protobuf.ProfileShowcaseAccountPreference {
out := make([]*protobuf.ProfileShowcaseAccountPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, ToProfileShowcaseAccountPreferenceProto(p))
}
return out
}
func FromProfileShowcaseCollectiblePreferenceProto(p *protobuf.ProfileShowcaseCollectiblePreference) *identity.ProfileShowcaseCollectiblePreference {
return &identity.ProfileShowcaseCollectiblePreference{
ContractAddress: p.GetContractAddress(),
ChainID: p.GetChainId(),
TokenID: p.GetTokenId(),
CommunityID: p.GetCommunityId(),
AccountAddress: p.GetAccountAddress(),
ShowcaseVisibility: identity.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int(p.Order),
}
}
func FromProfileShowcaseCollectiblesPreferencesProto(preferences []*protobuf.ProfileShowcaseCollectiblePreference) []*identity.ProfileShowcaseCollectiblePreference {
out := make([]*identity.ProfileShowcaseCollectiblePreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, FromProfileShowcaseCollectiblePreferenceProto(p))
}
return out
}
func ToProfileShowcaseCollectiblePreferenceProto(p *identity.ProfileShowcaseCollectiblePreference) *protobuf.ProfileShowcaseCollectiblePreference {
return &protobuf.ProfileShowcaseCollectiblePreference{
ContractAddress: p.ContractAddress,
ChainId: p.ChainID,
TokenId: p.TokenID,
CommunityId: p.CommunityID,
AccountAddress: p.AccountAddress,
ShowcaseVisibility: protobuf.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int32(p.Order),
}
}
func ToProfileShowcaseCollectiblesPreferenceProto(preferences []*identity.ProfileShowcaseCollectiblePreference) []*protobuf.ProfileShowcaseCollectiblePreference {
out := make([]*protobuf.ProfileShowcaseCollectiblePreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, ToProfileShowcaseCollectiblePreferenceProto(p))
}
return out
}
func FromProfileShowcaseVerifiedTokenPreferenceProto(p *protobuf.ProfileShowcaseVerifiedTokenPreference) *identity.ProfileShowcaseVerifiedTokenPreference {
return &identity.ProfileShowcaseVerifiedTokenPreference{
Symbol: p.GetSymbol(),
ShowcaseVisibility: identity.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int(p.Order),
}
}
func FromProfileShowcaseVerifiedTokensPreferencesProto(preferences []*protobuf.ProfileShowcaseVerifiedTokenPreference) []*identity.ProfileShowcaseVerifiedTokenPreference {
out := make([]*identity.ProfileShowcaseVerifiedTokenPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, FromProfileShowcaseVerifiedTokenPreferenceProto(p))
}
return out
}
func ToProfileShowcaseVerifiedTokenPreferenceProto(p *identity.ProfileShowcaseVerifiedTokenPreference) *protobuf.ProfileShowcaseVerifiedTokenPreference {
return &protobuf.ProfileShowcaseVerifiedTokenPreference{
Symbol: p.Symbol,
ShowcaseVisibility: protobuf.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int32(p.Order),
}
}
func ToProfileShowcaseVerifiedTokensPreferenceProto(preferences []*identity.ProfileShowcaseVerifiedTokenPreference) []*protobuf.ProfileShowcaseVerifiedTokenPreference {
out := make([]*protobuf.ProfileShowcaseVerifiedTokenPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, ToProfileShowcaseVerifiedTokenPreferenceProto(p))
}
return out
}
func FromProfileShowcaseUnverifiedTokenPreferenceProto(p *protobuf.ProfileShowcaseUnverifiedTokenPreference) *identity.ProfileShowcaseUnverifiedTokenPreference {
return &identity.ProfileShowcaseUnverifiedTokenPreference{
ContractAddress: p.GetContractAddress(),
ChainID: p.GetChainId(),
CommunityID: p.GetCommunityId(),
ShowcaseVisibility: identity.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int(p.Order),
}
}
func FromProfileShowcaseUnverifiedTokensPreferencesProto(preferences []*protobuf.ProfileShowcaseUnverifiedTokenPreference) []*identity.ProfileShowcaseUnverifiedTokenPreference {
out := make([]*identity.ProfileShowcaseUnverifiedTokenPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, FromProfileShowcaseUnverifiedTokenPreferenceProto(p))
}
return out
}
func ToProfileShowcaseUnverifiedTokenPreferenceProto(p *identity.ProfileShowcaseUnverifiedTokenPreference) *protobuf.ProfileShowcaseUnverifiedTokenPreference {
return &protobuf.ProfileShowcaseUnverifiedTokenPreference{
ContractAddress: p.ContractAddress,
ChainId: p.ChainID,
CommunityId: p.CommunityID,
ShowcaseVisibility: protobuf.ProfileShowcaseVisibility(p.ShowcaseVisibility),
Order: int32(p.Order),
}
}
func ToProfileShowcaseUnverifiedTokensPreferenceProto(preferences []*identity.ProfileShowcaseUnverifiedTokenPreference) []*protobuf.ProfileShowcaseUnverifiedTokenPreference {
out := make([]*protobuf.ProfileShowcaseUnverifiedTokenPreference, 0, len(preferences))
for _, p := range preferences {
out = append(out, ToProfileShowcaseUnverifiedTokenPreferenceProto(p))
}
return out
}
func FromProfileShowcasePreferencesProto(p *protobuf.SyncProfileShowcasePreferences) *identity.ProfileShowcasePreferences {
return &identity.ProfileShowcasePreferences{
Clock: p.GetClock(),
Communities: FromProfileShowcaseCommunitiesPreferencesProto(p.Communities),
Accounts: FromProfileShowcaseAccountsPreferencesProto(p.Accounts),
Collectibles: FromProfileShowcaseCollectiblesPreferencesProto(p.Collectibles),
VerifiedTokens: FromProfileShowcaseVerifiedTokensPreferencesProto(p.VerifiedTokens),
UnverifiedTokens: FromProfileShowcaseUnverifiedTokensPreferencesProto(p.UnverifiedTokens),
}
}
func ToProfileShowcasePreferencesProto(p *identity.ProfileShowcasePreferences) *protobuf.SyncProfileShowcasePreferences {
return &protobuf.SyncProfileShowcasePreferences{
Clock: p.Clock,
Communities: ToProfileShowcaseCommunitiesPreferencesProto(p.Communities),
Accounts: ToProfileShowcaseAccountsPreferenceProto(p.Accounts),
Collectibles: ToProfileShowcaseCollectiblesPreferenceProto(p.Collectibles),
VerifiedTokens: ToProfileShowcaseVerifiedTokensPreferenceProto(p.VerifiedTokens),
UnverifiedTokens: ToProfileShowcaseUnverifiedTokensPreferenceProto(p.UnverifiedTokens),
}
}

View File

@ -112,75 +112,9 @@ func (s *TestMessengerProfileShowcase) verifiedContact(theirMessenger *Messenger
s.Require().Equal(common.ContactVerificationStateTrusted, resp.Messages()[0].ContactVerificationState)
}
func (s *TestMessengerProfileShowcase) prepareShowcasePreferences() *identity.ProfileShowcasePreferences {
return &identity.ProfileShowcasePreferences{
Communities: []*identity.ProfileShowcaseCommunityPreference{}, // empty to avoid fetching
Accounts: []*identity.ProfileShowcaseAccountPreference{
&identity.ProfileShowcaseAccountPreference{
Address: "0x32433445133424",
Name: "Status Account",
ColorID: "blue",
Emoji: "-_-",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 0,
},
&identity.ProfileShowcaseAccountPreference{
Address: "0x3845354643324",
Name: "Money Box",
ColorID: "red",
Emoji: ":o)",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityContacts,
Order: 1,
},
},
Collectibles: []*identity.ProfileShowcaseCollectiblePreference{
&identity.ProfileShowcaseCollectiblePreference{
ContractAddress: "0x12378534257568678487683576",
ChainID: 1,
TokenID: "0x12321389592999f903",
CommunityID: "0x01312357798976535",
AccountAddress: "0x32433445133424",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 0,
},
},
VerifiedTokens: []*identity.ProfileShowcaseVerifiedTokenPreference{
&identity.ProfileShowcaseVerifiedTokenPreference{
Symbol: "ETH",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 1,
},
&identity.ProfileShowcaseVerifiedTokenPreference{
Symbol: "DAI",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityIDVerifiedContacts,
Order: 2,
},
&identity.ProfileShowcaseVerifiedTokenPreference{
Symbol: "SNT",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityNoOne,
Order: 3,
},
},
UnverifiedTokens: []*identity.ProfileShowcaseUnverifiedTokenPreference{
&identity.ProfileShowcaseUnverifiedTokenPreference{
ContractAddress: "0x454525452023452",
ChainID: 3,
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 0,
},
&identity.ProfileShowcaseUnverifiedTokenPreference{
ContractAddress: "0x12312323323233",
ChainID: 6,
ShowcaseVisibility: identity.ProfileShowcaseVisibilityContacts,
Order: 1,
},
},
}
}
func (s *TestMessengerProfileShowcase) TestSaveAndGetProfileShowcasePreferences() {
request := s.prepareShowcasePreferences()
err := s.m.SetProfileShowcasePreferences(request)
request := DummyProfileShowcasePreferences()
err := s.m.SetProfileShowcasePreferences(request, false)
s.Require().NoError(err)
// Restored preferences shoulf be same as stored
@ -238,7 +172,7 @@ func (s *TestMessengerProfileShowcase) TestFailToSaveProfileShowcasePreferencesW
Collectibles: []*identity.ProfileShowcaseCollectiblePreference{collectibleEntry},
}
err := s.m.SetProfileShowcasePreferences(request)
err := s.m.SetProfileShowcasePreferences(request, false)
s.Require().Equal(identity.ErrorAccountVisibilityLowerThanCollectible, err)
}
@ -383,8 +317,8 @@ func (s *TestMessengerProfileShowcase) TestShareShowcasePreferences() {
s.verifiedContact(verifiedContact)
// Save preferences to dispatch changes
request := s.prepareShowcasePreferences()
err = s.m.SetProfileShowcasePreferences(request)
request := DummyProfileShowcasePreferences()
err = s.m.SetProfileShowcasePreferences(request, false)
s.Require().NoError(err)
contactID := types.EncodeHex(crypto.FromECDSAPub(&s.m.identity.PublicKey))
@ -525,7 +459,7 @@ func (s *TestMessengerProfileShowcase) TestProfileShowcaseProofOfMembershipUnenc
Order: 2,
},
},
})
}, false)
s.Require().NoError(err)
contactID := types.EncodeHex(crypto.FromECDSAPub(&alice.identity.PublicKey))
@ -595,7 +529,7 @@ func (s *TestMessengerProfileShowcase) TestProfileShowcaseProofOfMembershipEncry
Order: 1,
},
},
})
}, false)
s.Require().NoError(err)
contactID := types.EncodeHex(crypto.FromECDSAPub(&alice.identity.PublicKey))

View File

@ -327,6 +327,16 @@ func (m *Messenger) HandleSyncRawMessages(rawMessages []*protobuf.RawMessage) er
if err != nil {
return err
}
case protobuf.ApplicationMetadataMessage_SYNC_PROFILE_SHOWCASE_PREFERENCES:
var message protobuf.SyncProfileShowcasePreferences
err := proto.Unmarshal(rawMessage.GetPayload(), &message)
if err != nil {
return err
}
err = m.saveProfileShowcasePreferencesProto(&message, false)
if err != nil {
return err
}
}
}
response, err := m.saveDataAndPrepareResponse(state)

View File

@ -9,6 +9,8 @@ import (
"sync"
"time"
"github.com/status-im/status-go/protocol/identity"
waku2 "github.com/status-im/status-go/wakuv2"
"golang.org/x/exp/maps"
@ -355,3 +357,69 @@ func RandomBytes(length int) []byte {
}
return out
}
func DummyProfileShowcasePreferences() *identity.ProfileShowcasePreferences {
return &identity.ProfileShowcasePreferences{
Communities: []*identity.ProfileShowcaseCommunityPreference{}, // empty to avoid fetching
Accounts: []*identity.ProfileShowcaseAccountPreference{
{
Address: "0x32433445133424",
Name: "Status Account",
ColorID: "blue",
Emoji: "-_-",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 0,
},
{
Address: "0x3845354643324",
Name: "Money Box",
ColorID: "red",
Emoji: ":o)",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityContacts,
Order: 1,
},
},
Collectibles: []*identity.ProfileShowcaseCollectiblePreference{
{
ContractAddress: "0x12378534257568678487683576",
ChainID: 1,
TokenID: "0x12321389592999f903",
CommunityID: "0x01312357798976535",
AccountAddress: "0x32433445133424",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 0,
},
},
VerifiedTokens: []*identity.ProfileShowcaseVerifiedTokenPreference{
{
Symbol: "ETH",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 1,
},
{
Symbol: "DAI",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityIDVerifiedContacts,
Order: 2,
},
{
Symbol: "SNT",
ShowcaseVisibility: identity.ProfileShowcaseVisibilityNoOne,
Order: 3,
},
},
UnverifiedTokens: []*identity.ProfileShowcaseUnverifiedTokenPreference{
{
ContractAddress: "0x454525452023452",
ChainID: 3,
ShowcaseVisibility: identity.ProfileShowcaseVisibilityEveryone,
Order: 0,
},
{
ContractAddress: "0x12312323323233",
ChainID: 6,
ShowcaseVisibility: identity.ProfileShowcaseVisibilityContacts,
Order: 1,
},
},
}
}

View File

@ -122,6 +122,7 @@
// 1706028033_profile_showcase_address_and_community.up.sql (2.42kB)
// 1706520870_add_bridge_messages_table.up.sql (389B)
// 1707749393_add_community_grants.up.sql (147B)
// 1707841194_add_profile_showcase_preferences.up.sql (132B)
// README.md (554B)
// doc.go (850B)
@ -2626,11 +2627,31 @@ func _1707749393_add_community_grantsUpSql() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "1707749393_add_community_grants.up.sql", size: 147, mode: os.FileMode(0644), modTime: time.Unix(1708080481, 0)}
info := bindataFileInfo{name: "1707749393_add_community_grants.up.sql", size: 147, mode: os.FileMode(0644), modTime: time.Unix(1708081117, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x59, 0xd9, 0xbb, 0x31, 0xf4, 0xb7, 0xbd, 0x1f, 0x57, 0x5b, 0x40, 0x28, 0xed, 0xf7, 0x2c, 0xb3, 0xf, 0xcc, 0x50, 0x7f, 0x2c, 0x74, 0xe1, 0x19, 0x7c, 0xa0, 0xec, 0xfc, 0xb7, 0xbe, 0x1e, 0xbc}}
return a, nil
}
var __1707841194_add_profile_showcase_preferencesUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x0e\x72\x75\x0c\x71\x55\x08\x71\x74\xf2\x71\x55\x28\x28\xca\x4f\xcb\xcc\x49\x8d\x2f\xce\xc8\x2f\x4f\x4e\x2c\x4e\x8d\x2f\x28\x4a\x4d\x4b\x2d\x4a\xcd\x4b\x4e\x2d\x56\xd0\xe0\x52\x50\x50\x50\x48\xce\xc9\x4f\xce\x56\xf0\xf4\x0b\x51\x70\x71\x75\x73\x0c\xf5\x09\x51\x30\xe0\xd2\xb4\xe6\xe2\xf2\xf4\x0b\x76\x0d\x0a\x01\x49\xf8\x13\x30\x06\x6c\x82\xa6\x42\x98\xa3\x4f\xa8\x6b\xb0\x82\x86\x81\xa6\x35\x20\x00\x00\xff\xff\x2d\x8d\x56\xab\x84\x00\x00\x00")
func _1707841194_add_profile_showcase_preferencesUpSqlBytes() ([]byte, error) {
return bindataRead(
__1707841194_add_profile_showcase_preferencesUpSql,
"1707841194_add_profile_showcase_preferences.up.sql",
)
}
func _1707841194_add_profile_showcase_preferencesUpSql() (*asset, error) {
bytes, err := _1707841194_add_profile_showcase_preferencesUpSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "1707841194_add_profile_showcase_preferences.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1708121648, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa4, 0x3b, 0x28, 0x2f, 0xd9, 0x3f, 0xe6, 0xe6, 0x22, 0xc7, 0x3, 0xcc, 0x4a, 0xc8, 0xc1, 0x8c, 0x32, 0xd5, 0x15, 0xc2, 0xaf, 0xf9, 0x2f, 0x2c, 0xaf, 0xab, 0xc4, 0xaf, 0x29, 0x8a, 0x33, 0x69}}
return a, nil
}
var _readmeMd = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x91\xc1\xce\xd3\x30\x10\x84\xef\x7e\x8a\x91\x7a\x01\xa9\x2a\x8f\xc0\x0d\x71\x82\x03\x48\x1c\xc9\x36\x9e\x36\x96\x1c\x6f\xf0\xae\x93\xe6\xed\x91\xa3\xc2\xdf\xff\x66\xed\xd8\x33\xdf\x78\x4f\xa7\x13\xbe\xea\x06\x57\x6c\x35\x39\x31\xa7\x7b\x15\x4f\x5a\xec\x73\x08\xbf\x08\x2d\x79\x7f\x4a\x43\x5b\x86\x17\xfd\x8c\x21\xea\x56\x5e\x47\x90\x4a\x14\x75\x48\xde\x64\x37\x2c\x6a\x96\xae\x99\x48\x05\xf6\x27\x77\x13\xad\x08\xae\x8a\x51\xe7\x25\xf3\xf1\xa9\x9f\xf9\x58\x58\x2c\xad\xbc\xe0\x8b\x56\xf0\x21\x5d\xeb\x4c\x95\xb3\xae\x84\x60\xd4\xdc\xe6\x82\x5d\x1b\x36\x6d\x39\x62\x92\xf5\xb8\x11\xdb\x92\xd3\x28\xce\xe0\x13\xe1\x72\xcd\x3c\x63\xd4\x65\x87\xae\xac\xe8\xc3\x28\x2e\x67\x44\x66\x3a\x21\x25\xa2\x72\xac\x14\x67\xbc\x84\x9f\x53\x32\x8c\x52\x70\x25\x56\xd6\xfd\x8d\x05\x37\xad\x30\x9d\x9f\xa6\x86\x0f\xcd\x58\x7f\xcf\x34\x93\x3b\xed\x90\x9f\xa4\x1f\xcf\x30\x85\x4d\x07\x58\xaf\x7f\x25\xc4\x9d\xf3\x72\x64\x84\xd0\x7f\xf9\x9b\x3a\x2d\x84\xef\x85\x48\x66\x8d\xd8\x88\x9b\x8c\x8c\x98\x5b\xf6\x74\x14\x4e\x33\x0d\xc9\xe0\x93\x38\xda\x12\xc5\x69\xbd\xe4\xf0\x2e\x7a\x78\x07\x1c\xfe\x13\x9f\x91\x29\x31\x95\x7b\x7f\x62\x59\x37\xb4\xe5\x5e\x25\xfe\x33\xee\xd5\x53\x71\xd6\xda\x3a\xd8\xcb\xde\x2e\xf8\xa1\x90\x55\x53\x0c\xc7\xaa\x0d\xe9\x76\x14\x29\x1c\x7b\x68\xdd\x2f\xe1\x6f\x00\x00\x00\xff\xff\x3c\x0a\xc2\xfe\x2a\x02\x00\x00")
func readmeMdBytes() ([]byte, error) {
@ -2884,6 +2905,7 @@ var _bindata = map[string]func() (*asset, error){
"1706028033_profile_showcase_address_and_community.up.sql": _1706028033_profile_showcase_address_and_communityUpSql,
"1706520870_add_bridge_messages_table.up.sql": _1706520870_add_bridge_messages_tableUpSql,
"1707749393_add_community_grants.up.sql": _1707749393_add_community_grantsUpSql,
"1707841194_add_profile_showcase_preferences.up.sql": _1707841194_add_profile_showcase_preferencesUpSql,
"README.md": readmeMd,
"doc.go": docGo,
}
@ -3056,6 +3078,7 @@ var _bintree = &bintree{nil, map[string]*bintree{
"1706028033_profile_showcase_address_and_community.up.sql": {_1706028033_profile_showcase_address_and_communityUpSql, map[string]*bintree{}},
"1706520870_add_bridge_messages_table.up.sql": {_1706520870_add_bridge_messages_tableUpSql, map[string]*bintree{}},
"1707749393_add_community_grants.up.sql": {_1707749393_add_community_grantsUpSql, map[string]*bintree{}},
"1707841194_add_profile_showcase_preferences.up.sql": {_1707841194_add_profile_showcase_preferencesUpSql, map[string]*bintree{}},
"README.md": {readmeMd, map[string]*bintree{}},
"doc.go": {docGo, map[string]*bintree{}},
}}

View File

@ -0,0 +1,5 @@
CREATE TABLE profile_showcase_preferences (
clock INT DEFAULT 0
);
INSERT INTO profile_showcase_preferences (clock) VALUES (0);

View File

@ -8,6 +8,9 @@ import (
"github.com/status-im/status-go/protocol/identity"
)
const upsertProfileShowcasePreferencesQuery = "UPDATE profile_showcase_preferences SET clock=? WHERE NOT EXISTS (SELECT 1 FROM profile_showcase_preferences WHERE clock >= ?)"
const selectProfileShowcasePreferencesQuery = "SELECT clock FROM profile_showcase_preferences"
const upsertProfileShowcaseCommunityPreferenceQuery = "INSERT OR REPLACE INTO profile_showcase_communities_preferences(community_id, visibility, sort_order) VALUES (?, ?, ?)" // #nosec G101
const selectProfileShowcaseCommunityPreferenceQuery = "SELECT community_id, visibility, sort_order FROM profile_showcase_communities_preferences" // #nosec G101
const deleteProfileShowcaseCommunityPreferenceQuery = "DELETE FROM profile_showcase_communities_preferences WHERE community_id = ?" // #nosec G101
@ -59,6 +62,18 @@ WHERE
`
// Queries for showcase preferences
func (db sqlitePersistence) saveProfileShowcasePreferencesClock(tx *sql.Tx, clock uint64) error {
_, err := tx.Exec(upsertProfileShowcasePreferencesQuery, clock, clock)
return err
}
func (db sqlitePersistence) getProfileShowcasePreferencesClock(tx *sql.Tx) (uint64, error) {
var clock uint64
err := tx.QueryRow(selectProfileShowcasePreferencesQuery).Scan(&clock)
return clock, err
}
func (db sqlitePersistence) saveProfileShowcaseCommunityPreference(tx *sql.Tx, community *identity.ProfileShowcaseCommunityPreference) error {
_, err := tx.Exec(upsertProfileShowcaseCommunityPreferenceQuery,
community.CommunityID,
@ -538,6 +553,11 @@ func (db sqlitePersistence) SaveProfileShowcasePreferences(preferences *identity
_ = tx.Rollback()
}()
err = db.saveProfileShowcasePreferencesClock(tx, preferences.Clock)
if err != nil {
return err
}
for _, community := range preferences.Communities {
err = db.saveProfileShowcaseCommunityPreference(tx, community)
if err != nil {
@ -606,6 +626,11 @@ func (db sqlitePersistence) GetProfileShowcasePreferences() (*identity.ProfileSh
_ = tx.Rollback()
}()
clock, err := db.getProfileShowcasePreferencesClock(tx)
if err != nil {
return nil, err
}
communities, err := db.getProfileShowcaseCommunitiesPreferences(tx)
if err != nil {
return nil, err
@ -632,6 +657,7 @@ func (db sqlitePersistence) GetProfileShowcasePreferences() (*identity.ProfileSh
}
return &identity.ProfileShowcasePreferences{
Clock: clock,
Communities: communities,
Accounts: accounts,
Collectibles: collectibles,

View File

@ -103,6 +103,7 @@ const (
ApplicationMetadataMessage_COMMUNITY_PUBLIC_SHARD_INFO ApplicationMetadataMessage_Type = 79
ApplicationMetadataMessage_SYNC_COLLECTIBLE_PREFERENCES ApplicationMetadataMessage_Type = 80
ApplicationMetadataMessage_COMMUNITY_USER_KICKED ApplicationMetadataMessage_Type = 81
ApplicationMetadataMessage_SYNC_PROFILE_SHOWCASE_PREFERENCES ApplicationMetadataMessage_Type = 82
)
// Enum value maps for ApplicationMetadataMessage_Type.
@ -186,6 +187,7 @@ var (
79: "COMMUNITY_PUBLIC_SHARD_INFO",
80: "SYNC_COLLECTIBLE_PREFERENCES",
81: "COMMUNITY_USER_KICKED",
82: "SYNC_PROFILE_SHOWCASE_PREFERENCES",
}
ApplicationMetadataMessage_Type_value = map[string]int32{
"UNKNOWN": 0,
@ -266,6 +268,7 @@ var (
"COMMUNITY_PUBLIC_SHARD_INFO": 79,
"SYNC_COLLECTIBLE_PREFERENCES": 80,
"COMMUNITY_USER_KICKED": 81,
"SYNC_PROFILE_SHOWCASE_PREFERENCES": 82,
}
)
@ -367,7 +370,7 @@ var File_application_metadata_message_proto protoreflect.FileDescriptor
var file_application_metadata_message_proto_rawDesc = []byte{
0x0a, 0x22, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0xa0,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0xc7,
0x14, 0x0a, 0x1a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a,
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
@ -377,7 +380,7 @@ var file_application_metadata_message_proto_rawDesc = []byte{
0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04,
0x74, 0x79, 0x70, 0x65, 0x22, 0x8a, 0x13, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a,
0x74, 0x79, 0x70, 0x65, 0x22, 0xb1, 0x13, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a,
0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x48,
0x41, 0x54, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e,
0x43, 0x4f, 0x4e, 0x54, 0x41, 0x43, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02,
@ -522,16 +525,18 @@ var file_application_metadata_message_proto_rawDesc = []byte{
0x4f, 0x4c, 0x4c, 0x45, 0x43, 0x54, 0x49, 0x42, 0x4c, 0x45, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x45,
0x52, 0x45, 0x4e, 0x43, 0x45, 0x53, 0x10, 0x50, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x4d, 0x4d,
0x55, 0x4e, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x4b, 0x49, 0x43, 0x4b, 0x45,
0x44, 0x10, 0x51, 0x22, 0x04, 0x08, 0x0e, 0x10, 0x0e, 0x22, 0x04, 0x08, 0x41, 0x10, 0x41, 0x22,
0x04, 0x08, 0x42, 0x10, 0x42, 0x2a, 0x1d, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x49, 0x4e, 0x53, 0x54,
0x41, 0x4c, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f,
0x43, 0x48, 0x41, 0x54, 0x2a, 0x22, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56,
0x49, 0x54, 0x59, 0x5f, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46,
0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2a, 0x27, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x41,
0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x4e,
0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54,
0x45, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x44, 0x10, 0x51, 0x12, 0x25, 0x0a, 0x21, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x50, 0x52, 0x4f, 0x46,
0x49, 0x4c, 0x45, 0x5f, 0x53, 0x48, 0x4f, 0x57, 0x43, 0x41, 0x53, 0x45, 0x5f, 0x50, 0x52, 0x45,
0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x53, 0x10, 0x52, 0x22, 0x04, 0x08, 0x0e, 0x10, 0x0e,
0x22, 0x04, 0x08, 0x41, 0x10, 0x41, 0x22, 0x04, 0x08, 0x42, 0x10, 0x42, 0x2a, 0x1d, 0x53, 0x59,
0x4e, 0x43, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f,
0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x43, 0x48, 0x41, 0x54, 0x2a, 0x22, 0x53, 0x59, 0x4e,
0x43, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x45, 0x4e, 0x54, 0x45,
0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2a,
0x27, 0x53, 0x59, 0x4e, 0x43, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, 0x5f, 0x43,
0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49,
0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -99,5 +99,6 @@ message ApplicationMetadataMessage {
COMMUNITY_PUBLIC_SHARD_INFO = 79;
SYNC_COLLECTIBLE_PREFERENCES = 80;
COMMUNITY_USER_KICKED = 81;
SYNC_PROFILE_SHOWCASE_PREFERENCES = 82;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ import "chat_identity.proto";
import "sync_settings.proto";
import 'application_metadata_message.proto';
import 'communities.proto';
import 'profile_showcase.proto';
option go_package = "./;protobuf";
package protobuf;
@ -376,6 +377,7 @@ message BackedUpProfile {
repeated SyncProfilePicture pictures = 4;
SyncSocialLinks social_links = 5;
repeated SyncEnsUsernameDetail ens_username_details = 6;
SyncProfileShowcasePreferences profile_showcase_preferences = 7;
}
message RawMessage {

View File

@ -20,6 +20,58 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ProfileShowcaseVisibility int32
const (
ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_NO_ONE ProfileShowcaseVisibility = 0
ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS ProfileShowcaseVisibility = 1
ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_CONTACTS ProfileShowcaseVisibility = 2
ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_EVERYONE ProfileShowcaseVisibility = 3
)
// Enum value maps for ProfileShowcaseVisibility.
var (
ProfileShowcaseVisibility_name = map[int32]string{
0: "PROFILE_SHOWCASE_VISIBILITY_NO_ONE",
1: "PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS",
2: "PROFILE_SHOWCASE_VISIBILITY_CONTACTS",
3: "PROFILE_SHOWCASE_VISIBILITY_EVERYONE",
}
ProfileShowcaseVisibility_value = map[string]int32{
"PROFILE_SHOWCASE_VISIBILITY_NO_ONE": 0,
"PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS": 1,
"PROFILE_SHOWCASE_VISIBILITY_CONTACTS": 2,
"PROFILE_SHOWCASE_VISIBILITY_EVERYONE": 3,
}
)
func (x ProfileShowcaseVisibility) Enum() *ProfileShowcaseVisibility {
p := new(ProfileShowcaseVisibility)
*p = x
return p
}
func (x ProfileShowcaseVisibility) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ProfileShowcaseVisibility) Descriptor() protoreflect.EnumDescriptor {
return file_profile_showcase_proto_enumTypes[0].Descriptor()
}
func (ProfileShowcaseVisibility) Type() protoreflect.EnumType {
return &file_profile_showcase_proto_enumTypes[0]
}
func (x ProfileShowcaseVisibility) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ProfileShowcaseVisibility.Descriptor instead.
func (ProfileShowcaseVisibility) EnumDescriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{0}
}
type ProfileShowcaseCommunity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -582,6 +634,480 @@ func (x *ProfileShowcase) GetForIdVerifiedContacts() *ProfileShowcaseEntriesEncr
return nil
}
type ProfileShowcaseCommunityPreference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CommunityId string `protobuf:"bytes,1,opt,name=community_id,json=communityId,proto3" json:"community_id,omitempty"`
ShowcaseVisibility ProfileShowcaseVisibility `protobuf:"varint,2,opt,name=showcase_visibility,json=showcaseVisibility,proto3,enum=protobuf.ProfileShowcaseVisibility" json:"showcase_visibility,omitempty"`
Order int32 `protobuf:"varint,3,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ProfileShowcaseCommunityPreference) Reset() {
*x = ProfileShowcaseCommunityPreference{}
if protoimpl.UnsafeEnabled {
mi := &file_profile_showcase_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProfileShowcaseCommunityPreference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProfileShowcaseCommunityPreference) ProtoMessage() {}
func (x *ProfileShowcaseCommunityPreference) ProtoReflect() protoreflect.Message {
mi := &file_profile_showcase_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProfileShowcaseCommunityPreference.ProtoReflect.Descriptor instead.
func (*ProfileShowcaseCommunityPreference) Descriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{8}
}
func (x *ProfileShowcaseCommunityPreference) GetCommunityId() string {
if x != nil {
return x.CommunityId
}
return ""
}
func (x *ProfileShowcaseCommunityPreference) GetShowcaseVisibility() ProfileShowcaseVisibility {
if x != nil {
return x.ShowcaseVisibility
}
return ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_NO_ONE
}
func (x *ProfileShowcaseCommunityPreference) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
type ProfileShowcaseAccountPreference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
ColorId string `protobuf:"bytes,3,opt,name=color_id,json=colorId,proto3" json:"color_id,omitempty"`
Emoji string `protobuf:"bytes,4,opt,name=emoji,proto3" json:"emoji,omitempty"`
ShowcaseVisibility ProfileShowcaseVisibility `protobuf:"varint,5,opt,name=showcase_visibility,json=showcaseVisibility,proto3,enum=protobuf.ProfileShowcaseVisibility" json:"showcase_visibility,omitempty"`
Order int32 `protobuf:"varint,6,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ProfileShowcaseAccountPreference) Reset() {
*x = ProfileShowcaseAccountPreference{}
if protoimpl.UnsafeEnabled {
mi := &file_profile_showcase_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProfileShowcaseAccountPreference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProfileShowcaseAccountPreference) ProtoMessage() {}
func (x *ProfileShowcaseAccountPreference) ProtoReflect() protoreflect.Message {
mi := &file_profile_showcase_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProfileShowcaseAccountPreference.ProtoReflect.Descriptor instead.
func (*ProfileShowcaseAccountPreference) Descriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{9}
}
func (x *ProfileShowcaseAccountPreference) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
func (x *ProfileShowcaseAccountPreference) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ProfileShowcaseAccountPreference) GetColorId() string {
if x != nil {
return x.ColorId
}
return ""
}
func (x *ProfileShowcaseAccountPreference) GetEmoji() string {
if x != nil {
return x.Emoji
}
return ""
}
func (x *ProfileShowcaseAccountPreference) GetShowcaseVisibility() ProfileShowcaseVisibility {
if x != nil {
return x.ShowcaseVisibility
}
return ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_NO_ONE
}
func (x *ProfileShowcaseAccountPreference) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
type ProfileShowcaseCollectiblePreference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
CommunityId string `protobuf:"bytes,4,opt,name=community_id,json=communityId,proto3" json:"community_id,omitempty"`
AccountAddress string `protobuf:"bytes,5,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"`
ShowcaseVisibility ProfileShowcaseVisibility `protobuf:"varint,6,opt,name=showcase_visibility,json=showcaseVisibility,proto3,enum=protobuf.ProfileShowcaseVisibility" json:"showcase_visibility,omitempty"`
Order int32 `protobuf:"varint,7,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ProfileShowcaseCollectiblePreference) Reset() {
*x = ProfileShowcaseCollectiblePreference{}
if protoimpl.UnsafeEnabled {
mi := &file_profile_showcase_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProfileShowcaseCollectiblePreference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProfileShowcaseCollectiblePreference) ProtoMessage() {}
func (x *ProfileShowcaseCollectiblePreference) ProtoReflect() protoreflect.Message {
mi := &file_profile_showcase_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProfileShowcaseCollectiblePreference.ProtoReflect.Descriptor instead.
func (*ProfileShowcaseCollectiblePreference) Descriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{10}
}
func (x *ProfileShowcaseCollectiblePreference) GetContractAddress() string {
if x != nil {
return x.ContractAddress
}
return ""
}
func (x *ProfileShowcaseCollectiblePreference) GetChainId() uint64 {
if x != nil {
return x.ChainId
}
return 0
}
func (x *ProfileShowcaseCollectiblePreference) GetTokenId() string {
if x != nil {
return x.TokenId
}
return ""
}
func (x *ProfileShowcaseCollectiblePreference) GetCommunityId() string {
if x != nil {
return x.CommunityId
}
return ""
}
func (x *ProfileShowcaseCollectiblePreference) GetAccountAddress() string {
if x != nil {
return x.AccountAddress
}
return ""
}
func (x *ProfileShowcaseCollectiblePreference) GetShowcaseVisibility() ProfileShowcaseVisibility {
if x != nil {
return x.ShowcaseVisibility
}
return ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_NO_ONE
}
func (x *ProfileShowcaseCollectiblePreference) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
type ProfileShowcaseVerifiedTokenPreference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
ShowcaseVisibility ProfileShowcaseVisibility `protobuf:"varint,2,opt,name=showcase_visibility,json=showcaseVisibility,proto3,enum=protobuf.ProfileShowcaseVisibility" json:"showcase_visibility,omitempty"`
Order int32 `protobuf:"varint,3,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ProfileShowcaseVerifiedTokenPreference) Reset() {
*x = ProfileShowcaseVerifiedTokenPreference{}
if protoimpl.UnsafeEnabled {
mi := &file_profile_showcase_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProfileShowcaseVerifiedTokenPreference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProfileShowcaseVerifiedTokenPreference) ProtoMessage() {}
func (x *ProfileShowcaseVerifiedTokenPreference) ProtoReflect() protoreflect.Message {
mi := &file_profile_showcase_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProfileShowcaseVerifiedTokenPreference.ProtoReflect.Descriptor instead.
func (*ProfileShowcaseVerifiedTokenPreference) Descriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{11}
}
func (x *ProfileShowcaseVerifiedTokenPreference) GetSymbol() string {
if x != nil {
return x.Symbol
}
return ""
}
func (x *ProfileShowcaseVerifiedTokenPreference) GetShowcaseVisibility() ProfileShowcaseVisibility {
if x != nil {
return x.ShowcaseVisibility
}
return ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_NO_ONE
}
func (x *ProfileShowcaseVerifiedTokenPreference) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
type ProfileShowcaseUnverifiedTokenPreference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
CommunityId string `protobuf:"bytes,3,opt,name=community_id,json=communityId,proto3" json:"community_id,omitempty"`
ShowcaseVisibility ProfileShowcaseVisibility `protobuf:"varint,4,opt,name=showcase_visibility,json=showcaseVisibility,proto3,enum=protobuf.ProfileShowcaseVisibility" json:"showcase_visibility,omitempty"`
Order int32 `protobuf:"varint,5,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ProfileShowcaseUnverifiedTokenPreference) Reset() {
*x = ProfileShowcaseUnverifiedTokenPreference{}
if protoimpl.UnsafeEnabled {
mi := &file_profile_showcase_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProfileShowcaseUnverifiedTokenPreference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProfileShowcaseUnverifiedTokenPreference) ProtoMessage() {}
func (x *ProfileShowcaseUnverifiedTokenPreference) ProtoReflect() protoreflect.Message {
mi := &file_profile_showcase_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProfileShowcaseUnverifiedTokenPreference.ProtoReflect.Descriptor instead.
func (*ProfileShowcaseUnverifiedTokenPreference) Descriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{12}
}
func (x *ProfileShowcaseUnverifiedTokenPreference) GetContractAddress() string {
if x != nil {
return x.ContractAddress
}
return ""
}
func (x *ProfileShowcaseUnverifiedTokenPreference) GetChainId() uint64 {
if x != nil {
return x.ChainId
}
return 0
}
func (x *ProfileShowcaseUnverifiedTokenPreference) GetCommunityId() string {
if x != nil {
return x.CommunityId
}
return ""
}
func (x *ProfileShowcaseUnverifiedTokenPreference) GetShowcaseVisibility() ProfileShowcaseVisibility {
if x != nil {
return x.ShowcaseVisibility
}
return ProfileShowcaseVisibility_PROFILE_SHOWCASE_VISIBILITY_NO_ONE
}
func (x *ProfileShowcaseUnverifiedTokenPreference) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
type SyncProfileShowcasePreferences struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"`
Communities []*ProfileShowcaseCommunityPreference `protobuf:"bytes,2,rep,name=communities,proto3" json:"communities,omitempty"`
Accounts []*ProfileShowcaseAccountPreference `protobuf:"bytes,3,rep,name=accounts,proto3" json:"accounts,omitempty"`
Collectibles []*ProfileShowcaseCollectiblePreference `protobuf:"bytes,4,rep,name=collectibles,proto3" json:"collectibles,omitempty"`
VerifiedTokens []*ProfileShowcaseVerifiedTokenPreference `protobuf:"bytes,5,rep,name=verified_tokens,json=verifiedTokens,proto3" json:"verified_tokens,omitempty"`
UnverifiedTokens []*ProfileShowcaseUnverifiedTokenPreference `protobuf:"bytes,6,rep,name=unverified_tokens,json=unverifiedTokens,proto3" json:"unverified_tokens,omitempty"`
}
func (x *SyncProfileShowcasePreferences) Reset() {
*x = SyncProfileShowcasePreferences{}
if protoimpl.UnsafeEnabled {
mi := &file_profile_showcase_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SyncProfileShowcasePreferences) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SyncProfileShowcasePreferences) ProtoMessage() {}
func (x *SyncProfileShowcasePreferences) ProtoReflect() protoreflect.Message {
mi := &file_profile_showcase_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SyncProfileShowcasePreferences.ProtoReflect.Descriptor instead.
func (*SyncProfileShowcasePreferences) Descriptor() ([]byte, []int) {
return file_profile_showcase_proto_rawDescGZIP(), []int{13}
}
func (x *SyncProfileShowcasePreferences) GetClock() uint64 {
if x != nil {
return x.Clock
}
return 0
}
func (x *SyncProfileShowcasePreferences) GetCommunities() []*ProfileShowcaseCommunityPreference {
if x != nil {
return x.Communities
}
return nil
}
func (x *SyncProfileShowcasePreferences) GetAccounts() []*ProfileShowcaseAccountPreference {
if x != nil {
return x.Accounts
}
return nil
}
func (x *SyncProfileShowcasePreferences) GetCollectibles() []*ProfileShowcaseCollectiblePreference {
if x != nil {
return x.Collectibles
}
return nil
}
func (x *SyncProfileShowcasePreferences) GetVerifiedTokens() []*ProfileShowcaseVerifiedTokenPreference {
if x != nil {
return x.VerifiedTokens
}
return nil
}
func (x *SyncProfileShowcasePreferences) GetUnverifiedTokens() []*ProfileShowcaseUnverifiedTokenPreference {
if x != nil {
return x.UnverifiedTokens
}
return nil
}
var File_profile_showcase_proto protoreflect.FileDescriptor
var file_profile_showcase_proto_rawDesc = []byte{
@ -682,8 +1208,125 @@ var file_profile_showcase_proto_rawDesc = []byte{
0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73,
0x65, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65,
0x64, 0x52, 0x15, 0x66, 0x6f, 0x72, 0x49, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64,
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x22, 0xb3, 0x01, 0x0a, 0x22, 0x50, 0x72, 0x6f,
0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d,
0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12,
0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79,
0x49, 0x64, 0x12, 0x54, 0x0a, 0x13, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x76,
0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69,
0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69,
0x6c, 0x69, 0x74, 0x79, 0x52, 0x12, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69,
0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0xed,
0x01, 0x0a, 0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61,
0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x6f,
0x6a, 0x69, 0x12, 0x54, 0x0a, 0x13, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x76,
0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69,
0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69,
0x6c, 0x69, 0x74, 0x79, 0x52, 0x12, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69,
0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0xbf,
0x02, 0x0a, 0x24, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61,
0x73, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x50, 0x72, 0x65,
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72,
0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65,
0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a,
0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d,
0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x61,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x12, 0x54, 0x0a, 0x13, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65,
0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f,
0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69, 0x73, 0x69,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x12, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65,
0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x22, 0xac, 0x01, 0x0a, 0x26, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77,
0x63, 0x61, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73,
0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d,
0x62, 0x6f, 0x6c, 0x12, 0x54, 0x0a, 0x13, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x5f,
0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66,
0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62,
0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x12, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56,
0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64,
0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22,
0xff, 0x01, 0x0a, 0x28, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63,
0x61, 0x73, 0x65, 0x55, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x6f, 0x6b,
0x65, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10,
0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e,
0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x5f,
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x75, 0x6e,
0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x54, 0x0a, 0x13, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73,
0x65, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72,
0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69, 0x73,
0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x12, 0x73, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73,
0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x22, 0xde, 0x03, 0x0a, 0x1e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c,
0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
0x6e, 0x63, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20,
0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x4e, 0x0a, 0x0b, 0x63, 0x6f,
0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69,
0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e,
0x69, 0x74, 0x79, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x63,
0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x08, 0x61, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53,
0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72,
0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x73, 0x12, 0x52, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x62, 0x6c,
0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63,
0x61, 0x73, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x50, 0x72,
0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63,
0x74, 0x69, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69,
0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69,
0x6c, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69,
0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63,
0x65, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x73, 0x12, 0x5f, 0x0a, 0x11, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53,
0x68, 0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x55, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65,
0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
0x52, 0x10, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x73, 0x2a, 0xcc, 0x01, 0x0a, 0x19, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x68,
0x6f, 0x77, 0x63, 0x61, 0x73, 0x65, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x12, 0x26, 0x0a, 0x22, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x53, 0x48, 0x4f, 0x57,
0x43, 0x41, 0x53, 0x45, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f,
0x4e, 0x4f, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2f, 0x50, 0x52, 0x4f, 0x46,
0x49, 0x4c, 0x45, 0x5f, 0x53, 0x48, 0x4f, 0x57, 0x43, 0x41, 0x53, 0x45, 0x5f, 0x56, 0x49, 0x53,
0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x49, 0x44, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49,
0x45, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x43, 0x54, 0x53, 0x10, 0x01, 0x12, 0x28, 0x0a,
0x24, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x53, 0x48, 0x4f, 0x57, 0x43, 0x41, 0x53,
0x45, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x43, 0x4f, 0x4e,
0x54, 0x41, 0x43, 0x54, 0x53, 0x10, 0x02, 0x12, 0x28, 0x0a, 0x24, 0x50, 0x52, 0x4f, 0x46, 0x49,
0x4c, 0x45, 0x5f, 0x53, 0x48, 0x4f, 0x57, 0x43, 0x41, 0x53, 0x45, 0x5f, 0x56, 0x49, 0x53, 0x49,
0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x45, 0x56, 0x45, 0x52, 0x59, 0x4f, 0x4e, 0x45, 0x10,
0x03, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -698,31 +1341,49 @@ func file_profile_showcase_proto_rawDescGZIP() []byte {
return file_profile_showcase_proto_rawDescData
}
var file_profile_showcase_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_profile_showcase_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_profile_showcase_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_profile_showcase_proto_goTypes = []interface{}{
(*ProfileShowcaseCommunity)(nil), // 0: protobuf.ProfileShowcaseCommunity
(*ProfileShowcaseAccount)(nil), // 1: protobuf.ProfileShowcaseAccount
(*ProfileShowcaseCollectible)(nil), // 2: protobuf.ProfileShowcaseCollectible
(*ProfileShowcaseVerifiedToken)(nil), // 3: protobuf.ProfileShowcaseVerifiedToken
(*ProfileShowcaseUnverifiedToken)(nil), // 4: protobuf.ProfileShowcaseUnverifiedToken
(*ProfileShowcaseEntries)(nil), // 5: protobuf.ProfileShowcaseEntries
(*ProfileShowcaseEntriesEncrypted)(nil), // 6: protobuf.ProfileShowcaseEntriesEncrypted
(*ProfileShowcase)(nil), // 7: protobuf.ProfileShowcase
(ProfileShowcaseVisibility)(0), // 0: protobuf.ProfileShowcaseVisibility
(*ProfileShowcaseCommunity)(nil), // 1: protobuf.ProfileShowcaseCommunity
(*ProfileShowcaseAccount)(nil), // 2: protobuf.ProfileShowcaseAccount
(*ProfileShowcaseCollectible)(nil), // 3: protobuf.ProfileShowcaseCollectible
(*ProfileShowcaseVerifiedToken)(nil), // 4: protobuf.ProfileShowcaseVerifiedToken
(*ProfileShowcaseUnverifiedToken)(nil), // 5: protobuf.ProfileShowcaseUnverifiedToken
(*ProfileShowcaseEntries)(nil), // 6: protobuf.ProfileShowcaseEntries
(*ProfileShowcaseEntriesEncrypted)(nil), // 7: protobuf.ProfileShowcaseEntriesEncrypted
(*ProfileShowcase)(nil), // 8: protobuf.ProfileShowcase
(*ProfileShowcaseCommunityPreference)(nil), // 9: protobuf.ProfileShowcaseCommunityPreference
(*ProfileShowcaseAccountPreference)(nil), // 10: protobuf.ProfileShowcaseAccountPreference
(*ProfileShowcaseCollectiblePreference)(nil), // 11: protobuf.ProfileShowcaseCollectiblePreference
(*ProfileShowcaseVerifiedTokenPreference)(nil), // 12: protobuf.ProfileShowcaseVerifiedTokenPreference
(*ProfileShowcaseUnverifiedTokenPreference)(nil), // 13: protobuf.ProfileShowcaseUnverifiedTokenPreference
(*SyncProfileShowcasePreferences)(nil), // 14: protobuf.SyncProfileShowcasePreferences
}
var file_profile_showcase_proto_depIdxs = []int32{
0, // 0: protobuf.ProfileShowcaseEntries.communities:type_name -> protobuf.ProfileShowcaseCommunity
1, // 1: protobuf.ProfileShowcaseEntries.accounts:type_name -> protobuf.ProfileShowcaseAccount
2, // 2: protobuf.ProfileShowcaseEntries.collectibles:type_name -> protobuf.ProfileShowcaseCollectible
3, // 3: protobuf.ProfileShowcaseEntries.verifiedTokens:type_name -> protobuf.ProfileShowcaseVerifiedToken
4, // 4: protobuf.ProfileShowcaseEntries.unverifiedTokens:type_name -> protobuf.ProfileShowcaseUnverifiedToken
5, // 5: protobuf.ProfileShowcase.for_everyone:type_name -> protobuf.ProfileShowcaseEntries
6, // 6: protobuf.ProfileShowcase.for_contacts:type_name -> protobuf.ProfileShowcaseEntriesEncrypted
6, // 7: protobuf.ProfileShowcase.for_id_verified_contacts:type_name -> protobuf.ProfileShowcaseEntriesEncrypted
8, // [8:8] is the sub-list for method output_type
8, // [8:8] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
1, // 0: protobuf.ProfileShowcaseEntries.communities:type_name -> protobuf.ProfileShowcaseCommunity
2, // 1: protobuf.ProfileShowcaseEntries.accounts:type_name -> protobuf.ProfileShowcaseAccount
3, // 2: protobuf.ProfileShowcaseEntries.collectibles:type_name -> protobuf.ProfileShowcaseCollectible
4, // 3: protobuf.ProfileShowcaseEntries.verifiedTokens:type_name -> protobuf.ProfileShowcaseVerifiedToken
5, // 4: protobuf.ProfileShowcaseEntries.unverifiedTokens:type_name -> protobuf.ProfileShowcaseUnverifiedToken
6, // 5: protobuf.ProfileShowcase.for_everyone:type_name -> protobuf.ProfileShowcaseEntries
7, // 6: protobuf.ProfileShowcase.for_contacts:type_name -> protobuf.ProfileShowcaseEntriesEncrypted
7, // 7: protobuf.ProfileShowcase.for_id_verified_contacts:type_name -> protobuf.ProfileShowcaseEntriesEncrypted
0, // 8: protobuf.ProfileShowcaseCommunityPreference.showcase_visibility:type_name -> protobuf.ProfileShowcaseVisibility
0, // 9: protobuf.ProfileShowcaseAccountPreference.showcase_visibility:type_name -> protobuf.ProfileShowcaseVisibility
0, // 10: protobuf.ProfileShowcaseCollectiblePreference.showcase_visibility:type_name -> protobuf.ProfileShowcaseVisibility
0, // 11: protobuf.ProfileShowcaseVerifiedTokenPreference.showcase_visibility:type_name -> protobuf.ProfileShowcaseVisibility
0, // 12: protobuf.ProfileShowcaseUnverifiedTokenPreference.showcase_visibility:type_name -> protobuf.ProfileShowcaseVisibility
9, // 13: protobuf.SyncProfileShowcasePreferences.communities:type_name -> protobuf.ProfileShowcaseCommunityPreference
10, // 14: protobuf.SyncProfileShowcasePreferences.accounts:type_name -> protobuf.ProfileShowcaseAccountPreference
11, // 15: protobuf.SyncProfileShowcasePreferences.collectibles:type_name -> protobuf.ProfileShowcaseCollectiblePreference
12, // 16: protobuf.SyncProfileShowcasePreferences.verified_tokens:type_name -> protobuf.ProfileShowcaseVerifiedTokenPreference
13, // 17: protobuf.SyncProfileShowcasePreferences.unverified_tokens:type_name -> protobuf.ProfileShowcaseUnverifiedTokenPreference
18, // [18:18] is the sub-list for method output_type
18, // [18:18] is the sub-list for method input_type
18, // [18:18] is the sub-list for extension type_name
18, // [18:18] is the sub-list for extension extendee
0, // [0:18] is the sub-list for field type_name
}
func init() { file_profile_showcase_proto_init() }
@ -827,19 +1488,92 @@ func file_profile_showcase_proto_init() {
return nil
}
}
file_profile_showcase_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProfileShowcaseCommunityPreference); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_profile_showcase_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProfileShowcaseAccountPreference); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_profile_showcase_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProfileShowcaseCollectiblePreference); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_profile_showcase_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProfileShowcaseVerifiedTokenPreference); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_profile_showcase_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProfileShowcaseUnverifiedTokenPreference); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_profile_showcase_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncProfileShowcasePreferences); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_profile_showcase_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumEnums: 1,
NumMessages: 14,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_profile_showcase_proto_goTypes,
DependencyIndexes: file_profile_showcase_proto_depIdxs,
EnumInfos: file_profile_showcase_proto_enumTypes,
MessageInfos: file_profile_showcase_proto_msgTypes,
}.Build()
File_profile_showcase_proto = out.File

View File

@ -57,3 +57,60 @@ message ProfileShowcase {
ProfileShowcaseEntriesEncrypted for_contacts = 2;
ProfileShowcaseEntriesEncrypted for_id_verified_contacts = 3;
}
// Preferences
enum ProfileShowcaseVisibility {
PROFILE_SHOWCASE_VISIBILITY_NO_ONE = 0;
PROFILE_SHOWCASE_VISIBILITY_IDVERIFIED_CONTACTS = 1;
PROFILE_SHOWCASE_VISIBILITY_CONTACTS = 2;
PROFILE_SHOWCASE_VISIBILITY_EVERYONE = 3;
}
message ProfileShowcaseCommunityPreference {
string community_id = 1;
ProfileShowcaseVisibility showcase_visibility = 2;
int32 order = 3;
}
message ProfileShowcaseAccountPreference {
string address = 1;
string name = 2;
string color_id = 3;
string emoji = 4;
ProfileShowcaseVisibility showcase_visibility = 5;
int32 order = 6;
}
message ProfileShowcaseCollectiblePreference {
string contract_address = 1;
uint64 chain_id = 2;
string token_id = 3;
string community_id = 4;
string account_address = 5;
ProfileShowcaseVisibility showcase_visibility = 6;
int32 order = 7;
}
message ProfileShowcaseVerifiedTokenPreference {
string symbol = 1;
ProfileShowcaseVisibility showcase_visibility = 2;
int32 order = 3;
}
message ProfileShowcaseUnverifiedTokenPreference {
string contract_address = 1;
uint64 chain_id = 2;
string community_id = 3;
ProfileShowcaseVisibility showcase_visibility = 4;
int32 order = 5;
}
message SyncProfileShowcasePreferences {
uint64 clock = 1;
repeated ProfileShowcaseCommunityPreference communities = 2;
repeated ProfileShowcaseAccountPreference accounts = 3;
repeated ProfileShowcaseCollectiblePreference collectibles = 4;
repeated ProfileShowcaseVerifiedTokenPreference verified_tokens = 5;
repeated ProfileShowcaseUnverifiedTokenPreference unverified_tokens = 6;
}

View File

@ -7,6 +7,7 @@ import (
"fmt"
"os"
"path/filepath"
"reflect"
"strings"
"testing"
"time"
@ -15,6 +16,7 @@ import (
"github.com/status-im/status-go/common/dbsetup"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/protocol"
"github.com/status-im/status-go/protocol/encryption/multidevice"
"github.com/status-im/status-go/protocol/tt"
@ -29,7 +31,6 @@ import (
"github.com/status-im/status-go/multiaccounts/accounts"
"github.com/status-im/status-go/multiaccounts/settings"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/protocol"
"github.com/status-im/status-go/protocol/common"
"github.com/status-im/status-go/protocol/identity"
"github.com/status-im/status-go/protocol/identity/alias"
@ -327,6 +328,12 @@ func (s *SyncDeviceSuite) TestPairingSyncDeviceClientAsSender() {
// generate ens username
err = clientBackend.StatusNode().EnsService().API().Add(ctx, ensChainID, ensUsername)
require.NoError(s.T(), err)
// generate profile showcase preferences
profileShowcasePreferences := protocol.DummyProfileShowcasePreferences()
err = clientBackend.Messenger().SetProfileShowcasePreferences(profileShowcasePreferences, false)
require.NoError(s.T(), err)
// startup sending client
clientActiveAccount, err := clientBackend.GetActiveAccount()
require.NoError(s.T(), err)
clientKeystorePath := filepath.Join(clientTmpDir, keystoreDir, clientActiveAccount.KeyUID)
@ -361,6 +368,9 @@ func (s *SyncDeviceSuite) TestPairingSyncDeviceClientAsSender() {
require.Equal(s.T(), uint64(ensChainID), uds[0].ChainID)
require.False(s.T(), uds[0].Removed)
require.Greater(s.T(), uds[0].Clock, uint64(0))
serverProfileShowcasePreferences, err := serverBackend.Messenger().GetProfileShowcasePreferences()
require.NoError(s.T(), err)
require.True(s.T(), reflect.DeepEqual(profileShowcasePreferences, serverProfileShowcasePreferences))
serverActiveAccount, err := serverBackend.GetActiveAccount()
require.NoError(s.T(), err)

View File

@ -1665,7 +1665,7 @@ func (api *PublicAPI) CreateTokenGatedCommunity() (*protocol.MessengerResponse,
// Set profile showcase preference for current user
func (api *PublicAPI) SetProfileShowcasePreferences(preferences *identity.ProfileShowcasePreferences) error {
return api.service.messenger.SetProfileShowcasePreferences(preferences)
return api.service.messenger.SetProfileShowcasePreferences(preferences, true)
}
// Get all profile showcase preferences for current user