chore: pairings file related properties removed from the local pairing
The pairings file is transferred along with the `SyncKeypair` message.
This commit is contained in:
parent
6894295ac3
commit
3bacb84a02
|
@ -15,10 +15,9 @@ type SenderConfig struct {
|
|||
// DeviceType SendPairInstallation need this information
|
||||
DeviceType string `json:"deviceType" validate:"required"`
|
||||
|
||||
KeyUID string `json:"keyUID" validate:"required,keyuid"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
ChatKey string `json:"chatKey"` // set only in case of a Keycard user, otherwise empty
|
||||
KeycardPairings string `json:"keycardPairings"`
|
||||
KeyUID string `json:"keyUID" validate:"required,keyuid"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
ChatKey string `json:"chatKey"` // set only in case of a Keycard user, otherwise empty
|
||||
|
||||
DB *multiaccounts.Database `json:"-"`
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ const (
|
|||
)
|
||||
|
||||
type AccountData struct {
|
||||
Account *multiaccounts.Account `json:"account,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
ChatKey string `json:"chatKey,omitempty"`
|
||||
KeycardPairings string `json:"keycardPairings,omitempty"`
|
||||
Account *multiaccounts.Account `json:"account,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
ChatKey string `json:"chatKey,omitempty"`
|
||||
}
|
||||
|
|
|
@ -25,11 +25,10 @@ var (
|
|||
|
||||
// AccountPayload represents the payload structure a Server handles
|
||||
type AccountPayload struct {
|
||||
keys map[string][]byte // nolint: structcheck
|
||||
multiaccount *multiaccounts.Account
|
||||
password string
|
||||
chatKey string
|
||||
keycardPairings string
|
||||
keys map[string][]byte // nolint: structcheck
|
||||
multiaccount *multiaccounts.Account
|
||||
password string
|
||||
chatKey string
|
||||
//flag if account already exist before sync account
|
||||
exist bool
|
||||
}
|
||||
|
@ -46,10 +45,9 @@ func NewPairingPayloadMarshaller(ap *AccountPayload, logger *zap.Logger) *Accoun
|
|||
|
||||
func (ppm *AccountPayloadMarshaller) MarshalProtobuf() ([]byte, error) {
|
||||
lpp := &protobuf.LocalPairingPayload{
|
||||
Keys: ppm.accountKeysToProtobuf(),
|
||||
Password: ppm.password,
|
||||
ChatKey: ppm.chatKey,
|
||||
KeycardPairings: ppm.keycardPairings,
|
||||
Keys: ppm.accountKeysToProtobuf(),
|
||||
Password: ppm.password,
|
||||
ChatKey: ppm.chatKey,
|
||||
}
|
||||
if ppm.multiaccount != nil {
|
||||
lpp.Multiaccount = ppm.multiaccount.ToProtobuf()
|
||||
|
@ -87,7 +85,7 @@ func (ppm *AccountPayloadMarshaller) UnmarshalProtobuf(data []byte) error {
|
|||
}
|
||||
ppm.password = pb.Password
|
||||
ppm.chatKey = pb.ChatKey
|
||||
ppm.keycardPairings = pb.KeycardPairings
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,6 @@ func NewAccountPayloadLoader(p *AccountPayload, config *SenderConfig) (*AccountP
|
|||
ppr.keyUID = config.KeyUID
|
||||
ppr.password = config.Password
|
||||
ppr.chatKey = config.ChatKey
|
||||
ppr.keycardPairings = config.KeycardPairings
|
||||
ppr.keystorePath = config.KeystorePath
|
||||
return ppr, nil
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ func NewAccountPayloadReceiver(e *PayloadEncryptor, p *AccountPayload, config *R
|
|||
|
||||
return NewBasePayloadReceiver(e, NewPairingPayloadMarshaller(p, l), aps,
|
||||
func() {
|
||||
data := AccountData{Account: p.multiaccount, Password: p.password, ChatKey: p.chatKey, KeycardPairings: p.keycardPairings}
|
||||
data := AccountData{Account: p.multiaccount, Password: p.password, ChatKey: p.chatKey}
|
||||
signal.SendLocalPairingEvent(Event{Type: EventReceivedAccount, Action: ActionPairingAccount, Data: data})
|
||||
},
|
||||
), nil
|
||||
|
|
Loading…
Reference in New Issue