Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion groupsv2/groupsv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func HandleGroupsV2(src string, dm *signalservice.DataMessage) (*GroupV2, error)
log.Errorln("[textsecure][groupsv2] signature verification failed", err)
return nil, err
}
log.Debugln("[textsecure][groupsv2] signature verification succesful")
log.Debugln("[textsecure][groupsv2] signature verification successful")
}
}

Expand Down
26 changes: 17 additions & 9 deletions profiles/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,30 @@ type Profile struct {

func GetProfile(UUID string, profileKey []byte) (*Profile, error) {
resp, err := transport.Transport.Get(fmt.Sprintf(PROFILE_PATH, UUID))
profile := &Profile{}

if err != nil {
log.Debugln("[textsecure] GetProfile", err)
return nil, err
}
if resp.IsError() {
log.Debugln("[textsecure] GetProfile", resp)
return nil, resp
}

dec := json.NewDecoder(resp.Body)
profile := &Profile{}
err = dec.Decode(&profile)
if err != nil {
log.Debugln("[textsecure] GetProfile", err)
return nil, err
} else {
err = decryptProfile(profileKey, profile)
if err != nil {
log.Debugln("[textsecure] ", err)
return nil, err
}
}
return profile, nil

err = decryptProfile(profileKey, profile)
if err != nil {
log.Debugln("[textsecure] GetProfile", err)
return nil, err
}

return profile, nil
}
func GetProfileAndCredential(UUID string, profileKey []byte) (*Profile, error) {
log.Infoln("[textsecure] GetProfileAndCredential")
Expand Down