From 0e612a2e15c6dd6cdf26653eabdf924771c8b04c Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 24 Jun 2021 18:18:14 -0700 Subject: [PATCH] Include version in legacy requests --- cmd/signaldctl/cmd/account/link/link-account.go | 2 +- cmd/signaldctl/cmd/account/list/list-accounts.go | 5 +++-- signald/client-protocol/v0/signaldrequest.go | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/signaldctl/cmd/account/link/link-account.go b/cmd/signaldctl/cmd/account/link/link-account.go index 6a639f7..6aec928 100644 --- a/cmd/signaldctl/cmd/account/link/link-account.go +++ b/cmd/signaldctl/cmd/account/link/link-account.go @@ -38,7 +38,7 @@ var ( Short: "create a local account by linking to an existing Signal account", Run: func(_ *cobra.Command, _ []string) { requestID := signald.GenerateID() - err := common.Signald.RawRequest(v0.LegacyRequest{Type: "link", ID: requestID}) + err := common.Signald.RawRequest(v0.LegacyRequest{Type: "link", ID: requestID, Version: "v0"}) if err != nil { log.Fatal("error sending request: ", err) } diff --git a/cmd/signaldctl/cmd/account/list/list-accounts.go b/cmd/signaldctl/cmd/account/list/list-accounts.go index 6b44feb..df3a8ee 100644 --- a/cmd/signaldctl/cmd/account/list/list-accounts.go +++ b/cmd/signaldctl/cmd/account/list/list-accounts.go @@ -36,8 +36,9 @@ var ( Run: func(_ *cobra.Command, _ []string) { requestID := signald.GenerateID() err := common.Signald.RawRequest(v0.LegacyRequest{ - Type: "list_accounts", - ID: requestID, + Type: "list_accounts", + ID: requestID, + Version: "v0", }) if err != nil { log.Fatal("error sending request: ", err) diff --git a/signald/client-protocol/v0/signaldrequest.go b/signald/client-protocol/v0/signaldrequest.go index a695cd3..ea7d7aa 100644 --- a/signald/client-protocol/v0/signaldrequest.go +++ b/signald/client-protocol/v0/signaldrequest.go @@ -33,6 +33,7 @@ type LegacyRequest struct { Members []string `json:"members,omitempty"` Avatar string `json:"avatar,omitempty"` Captcha string `json:"captcha,omitempty"` + Version string `json:"version,omitempty"` } type JsonAddress struct {