Make profile photos visible by default (#3553)

* Make profile photos visible by default

* Slight refactoring
This commit is contained in:
Alexander 2023-06-19 18:55:04 +02:00 committed by GitHub
parent f702b54d08
commit 49187cc553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 65 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {