Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Aug 31, 2022
1 parent 348b61e commit 233b034
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
38 changes: 20 additions & 18 deletions profiles/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,35 +256,37 @@ func GetProfileAndCredential(UUID string, profileKey []byte) (*Profile, error) {
log.Debugln("[textsecure] GetProfileAndCredential", err)
return nil, err
}
log.Debugln("[textsecure] GetProfileAndCredential credential length", len(credential))
profile.Credential = credential
return profile, err

}
func decryptProfile(profileKey []byte, profile *Profile) error {
log.Println("[textsecure] decryptProfile")
name, err := decryptString(profileKey, profile.Name)
if err != nil {
log.Debugln("[textsecure] decryptProfile name", profile.Name, err)
return err
}
profile.Name = name
if profile.About != "" {
about, err := decryptString(profileKey, profile.About)
if profile.Name != "" {
name, err := decryptString(profileKey, profile.Name)
if err != nil {
log.Debugln("[textsecure] decryptProfile about", err)
log.Debugln("[textsecure] decryptProfile name", profile.Name, err)
return err
}
profile.About = about
}
if profile.AboutEmoji != "" {
profile.Name = name

emoji, err := decryptString(profileKey, profile.AboutEmoji)
if err != nil {
log.Debugln("[textsecure] decryptProfile aboutEmoji", err)
return err
if profile.About != "" {
about, err := decryptString(profileKey, profile.About)
if err != nil {
log.Debugln("[textsecure] decryptProfile about", err)
return err
}
profile.About = about
}
if profile.AboutEmoji != "" {

emoji, err := decryptString(profileKey, profile.AboutEmoji)
if err != nil {
log.Debugln("[textsecure] decryptProfile aboutEmoji", err)
return err
}
profile.AboutEmoji = emoji
}
profile.AboutEmoji = emoji
}
identityKey, err := base64.StdEncoding.DecodeString(profile.IdentityKey)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion textsecure.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ func handleReceivedMessage(env *signalservice.Envelope) error {
}

p, _ := proto.Marshal(env)
log.Debugf("[textsecure] Incoming UnidentifiedSenderMessage %s.\n", env)
log.Debugf("[textsecure] Incoming UnidentifiedSenderMessage %s.\n", *env.DestinationUuid)
data, err := crayfish.Instance.HandleEnvelope(p)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func StartListening() error {
}
err = handleReceivedMessage(env)
if err != nil {
log.Debugf("[textsecure] Failed to handle received message: %+v", env)
log.WithFields(log.Fields{
"error": err,
}).Error("[textsecure] Failed to handle received message")
Expand Down

0 comments on commit 233b034

Please sign in to comment.