Added debug to HandleChatIdentity
This commit is contained in:
parent
30dc634951
commit
481c9c1287
|
@ -821,6 +821,7 @@ func (m *MessageHandler) HandleChatIdentity(state *ReceivedMessageState, ci prot
|
||||||
// In this case the contact update would not be processed
|
// In this case the contact update would not be processed
|
||||||
//
|
//
|
||||||
// TODO Potential fix: create an ChatIdentity last updated field on the contact table.
|
// TODO Potential fix: create an ChatIdentity last updated field on the contact table.
|
||||||
|
logger.Debug(fmt.Sprintf("Update times, contact.LastUpdated '%d', ChatIdentity.Clock '%d'", contact.LastUpdated, ci.Clock))
|
||||||
if contact.LastUpdated < ci.Clock {
|
if contact.LastUpdated < ci.Clock {
|
||||||
logger.Info("Updating contact")
|
logger.Info("Updating contact")
|
||||||
if !contact.HasBeenAdded() && contact.ID != contactIDFromPublicKey(&m.identity.PublicKey) {
|
if !contact.HasBeenAdded() && contact.ID != contactIDFromPublicKey(&m.identity.PublicKey) {
|
||||||
|
@ -833,6 +834,7 @@ func (m *MessageHandler) HandleChatIdentity(state *ReceivedMessageState, ci prot
|
||||||
contact.ENSVerified = false
|
contact.ENSVerified = false
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
logger.Debug(fmt.Sprintf("ChatIdentity has %d images attached", len(ci.Images)))
|
||||||
if len(ci.Images) > 0 {
|
if len(ci.Images) > 0 {
|
||||||
// Get the largest
|
// Get the largest
|
||||||
var name string
|
var name string
|
||||||
|
@ -844,11 +846,15 @@ func (m *MessageHandler) HandleChatIdentity(state *ReceivedMessageState, ci prot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Debug(fmt.Sprintf("largest image : name '%s', size '%d'", name, iiSize))
|
||||||
|
|
||||||
dataURI, err := images.GetPayloadDataURI(ci.Images[name].Payload)
|
dataURI, err := images.GetPayloadDataURI(ci.Images[name].Payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
contact.Photo = dataURI
|
contact.Photo = dataURI
|
||||||
|
|
||||||
|
logger.Debug(fmt.Sprintf("image payload '%s'", dataURI))
|
||||||
}
|
}
|
||||||
|
|
||||||
contact.LastUpdated = ci.Clock
|
contact.LastUpdated = ci.Clock
|
||||||
|
|
Loading…
Reference in New Issue