From 3ca2d6f6c91d44f34fca3221c430d1c47fa31a5a Mon Sep 17 00:00:00 2001 From: Finn Date: Tue, 11 May 2021 12:42:36 -0700 Subject: [PATCH] Add support for v2 groups on incoming --- signald/client-protocol/v0/signaldresponse.go | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/signald/client-protocol/v0/signaldresponse.go b/signald/client-protocol/v0/signaldresponse.go index 1ac0349..9960afe 100644 --- a/signald/client-protocol/v0/signaldresponse.go +++ b/signald/client-protocol/v0/signaldresponse.go @@ -43,14 +43,25 @@ type Account struct { // DataMessage is the main component of incoming text messages type DataMessage struct { - Timestamp int64 `json:",omitempty"` - Body string `json:",omitempty"` - ExpiresInSeconds int64 `json:",omitempty"` - GroupInfo IncomingGroupInfo `json:"group,omitempty"` + Timestamp int64 `json:",omitempty"` + Body string `json:",omitempty"` + ExpiresInSeconds int64 `json:",omitempty"` + GroupInfo IncomingGroupInfo `json:"group,omitempty"` + GroupV2 IncomingGroupV2Info `json:"groupV2,omitempty"` } -// IncomingGroupInfo is information about a particular group +// IncomingGroupInfo is information about a particular legacy group type IncomingGroupInfo struct { GroupID string `json:",omitempty"` Type string `json:",omitempty"` } + +// IncomingGroupV2Info is a stripped down copy of v1.JsonGroupV2Info because v0 can't depend on v1 +type IncomingGroupV2Info struct { + Avatar string `json:"avatar,omitempty" yaml:"avatar,omitempty"` // path to the group's avatar on local disk, if available + ID string `json:"id,omitempty" yaml:"id,omitempty"` + InviteLink string `json:"inviteLink,omitempty" yaml:"inviteLink,omitempty"` // the signal.group link, if applicable + Revision int32 `json:"revision,omitempty" yaml:"revision,omitempty"` + Timer int32 `json:"timer,omitempty" yaml:"timer,omitempty"` + Title string `json:"title,omitempty" yaml:"title,omitempty"` +}