diff --git a/src/client/client.go b/src/client/client.go index 3c882b3..2e59ca7 100644 --- a/src/client/client.go +++ b/src/client/client.go @@ -214,6 +214,31 @@ type ContactProfile struct { LastUpdatedTimestamp int64 `json:"last_updated_timestamp"` } +type SignalCliProfileResponse struct { + LastUpdateTimestamp int64 `json:"lastUpdateTimestamp"` + GivenName string `json:"givenName"` + FamilyName string `json:"familyName"` + About string `json:"about"` + HasAvatar bool `json:"hasAvatar"` +} + +type ListContactsSignalCliResponse struct { + Number string `json:"number"` + Uuid string `json:"uuid"` + Name string `json:"name"` + ProfileName string `json:"profileName"` + Username string `json:"username"` + Color string `json:"color"` + Blocked bool `json:"blocked"` + MessageExpiration string `json:"messageExpiration"` + Note string `json:"note"` + GivenName string `json:"givenName"` + Profile SignalCliProfileResponse `json:"profile"` + Nickname string `json:"nickName"` + NickGivenName string `json:"nickGivenName"` + NickFamilyName string `json:"nickFamilyName"` +} + type Nickname struct { Name string `json:"name"` GivenName string `json:"given_name"` @@ -2601,29 +2626,6 @@ func (s *SignalClient) AddStickerPack(number string, packId string, packKey stri return err } } - type SignalCliProfileResponse struct { - LastUpdateTimestamp int64 `json:"lastUpdateTimestamp"` - GivenName string `json:"givenName"` - FamilyName string `json:"familyName"` - About string `json:"about"` - HasAvatar bool `json:"hasAvatar"` - } -type ListContactsSignlCliResponse struct { - Number string `json:"number"` - Uuid string `json:"uuid"` - Name string `json:"name"` - ProfileName string `json:"profileName"` - Username string `json:"username"` - Color string `json:"color"` - Blocked bool `json:"blocked"` - MessageExpiration string `json:"messageExpiration"` - Note string `json:"note"` - GivenName string `json:"givenName"` - Profile SignalCliProfileResponse `json:"profile"` - Nickname string `json:"nickName"` - NickGivenName string `json:"nickGivenName"` - NickFamilyName string `json:"nickFamilyName"` - } func (s *SignalClient) ListContacts(number string, allRecipients bool) ([]ListContactsResponse, error) { resp := []ListContactsResponse{} @@ -2655,7 +2657,7 @@ func (s *SignalClient) ListContacts(number string, allRecipients bool) ([]ListCo } } - var signalCliResp []ListContactsSignlCliResponse + var signalCliResp []ListContactsSignalCliResponse err = json.Unmarshal([]byte(rawData), &signalCliResp) if err != nil { log.Error("Couldn't list contacts", err.Error()) @@ -2721,7 +2723,7 @@ func (s *SignalClient) ListContact(number string, uuid string, allRecipients boo } } - var signalCliResp []ListContactsSignlCliResponse + var signalCliResp []ListContactsSignalCliResponse err = json.Unmarshal([]byte(rawData), &signalCliResp) if err != nil { log.Error("Couldn't list contacts", err.Error())