diff --git a/api/defaults.go b/api/defaults.go index 510a4777d..7bcec7ece 100644 --- a/api/defaults.go +++ b/api/defaults.go @@ -33,7 +33,8 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive s.BackupEnabled = true logLevel := "INFO" s.LogLevel = &logLevel - s.ProfilePicturesShowTo = settings.ProfilePicturesShowToContactsOnly + s.ProfilePicturesShowTo = settings.ProfilePicturesShowToEveryone + s.ProfilePicturesVisibility = settings.ProfilePicturesVisibilityEveryone s.KeyUID = generatedAccountInfo.KeyUID s.Address = types.HexToAddress(generatedAccountInfo.Address) s.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) @@ -62,7 +63,6 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive s.PreviewPrivacy = true s.Currency = "usd" - s.ProfilePicturesVisibility = 1 s.LinkPreviewRequestEnabled = true visibleTokens := make(map[string][]string) diff --git a/cmd/ping-community/main.go b/cmd/ping-community/main.go index c5a274740..414b21891 100644 --- a/cmd/ping-community/main.go +++ b/cmd/ping-community/main.go @@ -266,37 +266,37 @@ var paths = []string{pathWalletRoot, pathEIP1581, pathDefaultChat, pathDefaultWa func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derivedAddresses map[string]generator.AccountInfo, mnemonic *string) (*settings.Settings, error) { chatKeyString := derivedAddresses[pathDefaultChat].PublicKey - settings := &settings.Settings{} - settings.KeyUID = generatedAccountInfo.KeyUID - settings.Address = types.HexToAddress(generatedAccountInfo.Address) - settings.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) + defaultSettings := &settings.Settings{} + defaultSettings.KeyUID = generatedAccountInfo.KeyUID + defaultSettings.Address = types.HexToAddress(generatedAccountInfo.Address) + defaultSettings.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) // Set chat key & name name, err := alias.GenerateFromPublicKeyString(chatKeyString) if err != nil { return nil, err } - settings.Name = name - settings.PublicKey = chatKeyString + defaultSettings.Name = name + defaultSettings.PublicKey = chatKeyString - settings.DappsAddress = types.HexToAddress(derivedAddresses[pathDefaultWallet].Address) - settings.EIP1581Address = types.HexToAddress(derivedAddresses[pathEIP1581].Address) - settings.Mnemonic = mnemonic + defaultSettings.DappsAddress = types.HexToAddress(derivedAddresses[pathDefaultWallet].Address) + defaultSettings.EIP1581Address = types.HexToAddress(derivedAddresses[pathEIP1581].Address) + defaultSettings.Mnemonic = mnemonic signingPhrase, err := buildSigningPhrase() if err != nil { return nil, err } - settings.SigningPhrase = signingPhrase + defaultSettings.SigningPhrase = signingPhrase - settings.SendPushNotifications = true - settings.InstallationID = uuid.New().String() - settings.UseMailservers = true + defaultSettings.SendPushNotifications = true + defaultSettings.InstallationID = uuid.New().String() + defaultSettings.UseMailservers = true - settings.PreviewPrivacy = true - settings.Currency = "usd" - settings.ProfilePicturesVisibility = 1 - settings.LinkPreviewRequestEnabled = true + defaultSettings.PreviewPrivacy = true + defaultSettings.Currency = "usd" + defaultSettings.ProfilePicturesVisibility = settings.ProfilePicturesVisibilityEveryone + defaultSettings.LinkPreviewRequestEnabled = true visibleTokens := make(map[string][]string) visibleTokens["mainnet"] = []string{"SNT"} @@ -305,7 +305,7 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive return nil, err } visibleTokenJSONRaw := json.RawMessage(visibleTokensJSON) - settings.WalletVisibleTokens = &visibleTokenJSONRaw + defaultSettings.WalletVisibleTokens = &visibleTokenJSONRaw // TODO: fix this networks := make([]map[string]string, 0) @@ -314,10 +314,10 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive return nil, err } networkRawMessage := json.RawMessage(networksJSON) - settings.Networks = &networkRawMessage - settings.CurrentNetwork = "mainnet_rpc" + defaultSettings.Networks = &networkRawMessage + defaultSettings.CurrentNetwork = "mainnet_rpc" - return settings, nil + return defaultSettings, nil } func defaultNodeConfig(installationID string) (*params.NodeConfig, error) { diff --git a/cmd/populate-db/main.go b/cmd/populate-db/main.go index f39268520..68d0c4353 100644 --- a/cmd/populate-db/main.go +++ b/cmd/populate-db/main.go @@ -330,37 +330,37 @@ var paths = []string{pathWalletRoot, pathEIP1581, pathDefaultChat, pathDefaultWa func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derivedAddresses map[string]generator.AccountInfo, mnemonic *string) (*settings.Settings, error) { chatKeyString := derivedAddresses[pathDefaultChat].PublicKey - settings := &settings.Settings{} - settings.KeyUID = generatedAccountInfo.KeyUID - settings.Address = types.HexToAddress(generatedAccountInfo.Address) - settings.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) + defaultSettings := &settings.Settings{} + defaultSettings.KeyUID = generatedAccountInfo.KeyUID + defaultSettings.Address = types.HexToAddress(generatedAccountInfo.Address) + defaultSettings.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) // Set chat key & name name, err := alias.GenerateFromPublicKeyString(chatKeyString) if err != nil { return nil, err } - settings.Name = name - settings.PublicKey = chatKeyString + defaultSettings.Name = name + defaultSettings.PublicKey = chatKeyString - settings.DappsAddress = types.HexToAddress(derivedAddresses[pathDefaultWallet].Address) - settings.EIP1581Address = types.HexToAddress(derivedAddresses[pathEIP1581].Address) - settings.Mnemonic = mnemonic + defaultSettings.DappsAddress = types.HexToAddress(derivedAddresses[pathDefaultWallet].Address) + defaultSettings.EIP1581Address = types.HexToAddress(derivedAddresses[pathEIP1581].Address) + defaultSettings.Mnemonic = mnemonic signingPhrase, err := buildSigningPhrase() if err != nil { return nil, err } - settings.SigningPhrase = signingPhrase + defaultSettings.SigningPhrase = signingPhrase - settings.SendPushNotifications = true - settings.InstallationID = uuid.New().String() - settings.UseMailservers = true + defaultSettings.SendPushNotifications = true + defaultSettings.InstallationID = uuid.New().String() + defaultSettings.UseMailservers = true - settings.PreviewPrivacy = true - settings.Currency = "usd" - settings.ProfilePicturesVisibility = 1 - settings.LinkPreviewRequestEnabled = true + defaultSettings.PreviewPrivacy = true + defaultSettings.Currency = "usd" + defaultSettings.ProfilePicturesVisibility = settings.ProfilePicturesVisibilityEveryone + defaultSettings.LinkPreviewRequestEnabled = true visibleTokens := make(map[string][]string) visibleTokens["mainnet"] = []string{"SNT"} @@ -369,7 +369,7 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive return nil, err } visibleTokenJSONRaw := json.RawMessage(visibleTokensJSON) - settings.WalletVisibleTokens = &visibleTokenJSONRaw + defaultSettings.WalletVisibleTokens = &visibleTokenJSONRaw // TODO: fix this networks := make([]map[string]string, 0) @@ -378,10 +378,10 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive return nil, err } networkRawMessage := json.RawMessage(networksJSON) - settings.Networks = &networkRawMessage - settings.CurrentNetwork = "mainnet_rpc" + defaultSettings.Networks = &networkRawMessage + defaultSettings.CurrentNetwork = "mainnet_rpc" - return settings, nil + return defaultSettings, nil } func defaultNodeConfig(installationID string) (*params.NodeConfig, error) { diff --git a/cmd/spiff-workflow/main.go b/cmd/spiff-workflow/main.go index 549e827dd..72f8e4424 100644 --- a/cmd/spiff-workflow/main.go +++ b/cmd/spiff-workflow/main.go @@ -207,37 +207,37 @@ var paths = []string{pathWalletRoot, pathEIP1581, pathDefaultChat, pathDefaultWa func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derivedAddresses map[string]generator.AccountInfo, mnemonic *string) (*settings.Settings, error) { chatKeyString := derivedAddresses[pathDefaultChat].PublicKey - settings := &settings.Settings{} - settings.KeyUID = generatedAccountInfo.KeyUID - settings.Address = types.HexToAddress(generatedAccountInfo.Address) - settings.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) + defaultSettings := &settings.Settings{} + defaultSettings.KeyUID = generatedAccountInfo.KeyUID + defaultSettings.Address = types.HexToAddress(generatedAccountInfo.Address) + defaultSettings.WalletRootAddress = types.HexToAddress(derivedAddresses[pathWalletRoot].Address) // Set chat key & name name, err := alias.GenerateFromPublicKeyString(chatKeyString) if err != nil { return nil, err } - settings.Name = name - settings.PublicKey = chatKeyString + defaultSettings.Name = name + defaultSettings.PublicKey = chatKeyString - settings.DappsAddress = types.HexToAddress(derivedAddresses[pathDefaultWallet].Address) - settings.EIP1581Address = types.HexToAddress(derivedAddresses[pathEIP1581].Address) - settings.Mnemonic = mnemonic + defaultSettings.DappsAddress = types.HexToAddress(derivedAddresses[pathDefaultWallet].Address) + defaultSettings.EIP1581Address = types.HexToAddress(derivedAddresses[pathEIP1581].Address) + defaultSettings.Mnemonic = mnemonic signingPhrase, err := buildSigningPhrase() if err != nil { return nil, err } - settings.SigningPhrase = signingPhrase + defaultSettings.SigningPhrase = signingPhrase - settings.SendPushNotifications = true - settings.InstallationID = uuid.New().String() - settings.UseMailservers = true + defaultSettings.SendPushNotifications = true + defaultSettings.InstallationID = uuid.New().String() + defaultSettings.UseMailservers = true - settings.PreviewPrivacy = true - settings.Currency = "usd" - settings.ProfilePicturesVisibility = 1 - settings.LinkPreviewRequestEnabled = true + defaultSettings.PreviewPrivacy = true + defaultSettings.Currency = "usd" + defaultSettings.ProfilePicturesVisibility = settings.ProfilePicturesVisibilityEveryone + defaultSettings.LinkPreviewRequestEnabled = true visibleTokens := make(map[string][]string) visibleTokens["mainnet"] = []string{"SNT"} @@ -246,7 +246,7 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive return nil, err } visibleTokenJSONRaw := json.RawMessage(visibleTokensJSON) - settings.WalletVisibleTokens = &visibleTokenJSONRaw + defaultSettings.WalletVisibleTokens = &visibleTokenJSONRaw // TODO: fix this networks := make([]map[string]string, 0) @@ -255,10 +255,10 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive return nil, err } networkRawMessage := json.RawMessage(networksJSON) - settings.Networks = &networkRawMessage - settings.CurrentNetwork = "mainnet_rpc" + defaultSettings.Networks = &networkRawMessage + defaultSettings.CurrentNetwork = "mainnet_rpc" - return settings, nil + return defaultSettings, nil } func defaultNodeConfig(installationID string) (*params.NodeConfig, error) {