chore: use provided pictures visibility options when creating settings db entry (#2867)

When initially creating settings, properties 'initialize profile_pictures_show_to'
and 'profile_pictures_visibility' are set according to the provided Setting object.
This commit is contained in:
Michał 2022-10-05 12:53:42 +02:00 committed by GitHub
parent 571ab4c88d
commit 057c7915f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -109,10 +109,12 @@ INSERT INTO settings (
signing_phrase, signing_phrase,
wallet_root_address, wallet_root_address,
synthetic_id, synthetic_id,
current_user_status current_user_status,
profile_pictures_show_to,
profile_pictures_visibility
) VALUES ( ) VALUES (
?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?,?,?,
?,?,?,?,?,?,?,?,?,'id',?)`, ?,?,?,?,?,?,?,?,?,'id',?,?,?)`,
s.Address, s.Address,
s.Currency, s.Currency,
s.CurrentNetwork, s.CurrentNetwork,
@ -135,6 +137,8 @@ INSERT INTO settings (
s.SigningPhrase, s.SigningPhrase,
s.WalletRootAddress, s.WalletRootAddress,
s.CurrentUserStatus, s.CurrentUserStatus,
s.ProfilePicturesShowTo,
s.ProfilePicturesVisibility,
) )
if err != nil { if err != nil {
return err return err

View File

@ -141,6 +141,7 @@ func (s *MessengerSyncSettingsSuite) newMessengerWithOptions(shh types.Waku, pri
PublicKey: "0x04112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900", PublicKey: "0x04112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900",
SigningPhrase: "yurt joey vibe", SigningPhrase: "yurt joey vibe",
SendPushNotifications: true, SendPushNotifications: true,
ProfilePicturesShowTo: 1,
ProfilePicturesVisibility: 1, ProfilePicturesVisibility: 1,
DefaultSyncPeriod: 86400, DefaultSyncPeriod: 86400,
UseMailservers: true, UseMailservers: true,

View File

@ -131,7 +131,10 @@ func newMessengerWithKey(shh types.Waku, privateKey *ecdsa.PrivateKey, logger *z
WithAccount(iai.ToMultiAccount()), WithAccount(iai.ToMultiAccount()),
WithDatasync(), WithDatasync(),
WithToplevelDatabaseMigrations(), WithToplevelDatabaseMigrations(),
WithAppSettings(settings.Settings{}, params.NodeConfig{}), WithAppSettings(settings.Settings{
ProfilePicturesShowTo: 1,
ProfilePicturesVisibility: 1,
}, params.NodeConfig{}),
WithBrowserDatabase(nil), WithBrowserDatabase(nil),
} }