Add support for v2 groups on incoming

This commit is contained in:
Finn 2021-05-11 12:42:36 -07:00
parent b5802b75e1
commit 3ca2d6f6c9

View file

@ -43,14 +43,25 @@ type Account struct {
// DataMessage is the main component of incoming text messages // DataMessage is the main component of incoming text messages
type DataMessage struct { type DataMessage struct {
Timestamp int64 `json:",omitempty"` Timestamp int64 `json:",omitempty"`
Body string `json:",omitempty"` Body string `json:",omitempty"`
ExpiresInSeconds int64 `json:",omitempty"` ExpiresInSeconds int64 `json:",omitempty"`
GroupInfo IncomingGroupInfo `json:"group,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 { type IncomingGroupInfo struct {
GroupID string `json:",omitempty"` GroupID string `json:",omitempty"`
Type 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"`
}