fix_: set default user status to Automatic on account creationg (#5083)

This commit is contained in:
Igor Sirotin 2024-04-24 17:36:02 +02:00 committed by GitHub
parent 295685c1fe
commit 68bc9d39fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -12,7 +12,9 @@ import (
"github.com/status-im/status-go/eth-node/types"
"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/identity/alias"
"github.com/status-im/status-go/protocol/protobuf"
"github.com/status-im/status-go/protocol/requests"
)
@ -100,6 +102,19 @@ func defaultSettings(generatedAccountInfo generator.GeneratedAccountInfo, derive
s.TestNetworksEnabled = false
// Default user status
currentUserStatus, err := json.Marshal(protocol.UserStatus{
PublicKey: chatKeyString,
StatusType: int(protobuf.StatusUpdate_AUTOMATIC),
Clock: 0,
CustomText: "",
})
if err != nil {
return nil, err
}
userRawMessage := json.RawMessage(currentUserStatus)
s.CurrentUserStatus = &userRawMessage
return s, nil
}