diff --git a/server/pairing/config.go b/server/pairing/config.go index 3a16ce9ff..62e6cee59 100644 --- a/server/pairing/config.go +++ b/server/pairing/config.go @@ -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:"-"` } diff --git a/server/pairing/events.go b/server/pairing/events.go index 855d3921e..3b2310baa 100644 --- a/server/pairing/events.go +++ b/server/pairing/events.go @@ -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"` } diff --git a/server/pairing/payload_management.go b/server/pairing/payload_management.go index 1fd68edc9..a4d379a5b 100644 --- a/server/pairing/payload_management.go +++ b/server/pairing/payload_management.go @@ -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 } diff --git a/server/pairing/payload_mounter.go b/server/pairing/payload_mounter.go index 24006c3e2..dbaba5632 100644 --- a/server/pairing/payload_mounter.go +++ b/server/pairing/payload_mounter.go @@ -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 } diff --git a/server/pairing/payload_receiver.go b/server/pairing/payload_receiver.go index 95767a7d5..f1c6a4212 100644 --- a/server/pairing/payload_receiver.go +++ b/server/pairing/payload_receiver.go @@ -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