Fix: handle accepted contact verifaction if persistedVR is null (#4918)
This commit is contained in:
parent
baed7b9d83
commit
0aa1fb9eff
|
@ -869,20 +869,20 @@ func (m *Messenger) HandleAcceptContactVerification(state *ReceivedMessageState,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if persistedVR != nil && persistedVR.RepliedAt > request.Clock {
|
|
||||||
return nil // older message, ignore it
|
|
||||||
}
|
|
||||||
|
|
||||||
if persistedVR.RequestStatus == verification.RequestStatusCANCELED {
|
|
||||||
return nil // Do nothing, We have already cancelled the verification request
|
|
||||||
}
|
|
||||||
|
|
||||||
if persistedVR == nil {
|
if persistedVR == nil {
|
||||||
// This is a response for which we have not received its request before
|
// This is a response for which we have not received its request before
|
||||||
persistedVR = &verification.Request{}
|
persistedVR = &verification.Request{}
|
||||||
persistedVR.ID = request.Id
|
persistedVR.ID = request.Id
|
||||||
persistedVR.From = contactID
|
persistedVR.From = contactID
|
||||||
persistedVR.To = myPubKey
|
persistedVR.To = myPubKey
|
||||||
|
} else {
|
||||||
|
if persistedVR.RepliedAt > request.Clock {
|
||||||
|
return nil // older message, ignore it
|
||||||
|
}
|
||||||
|
|
||||||
|
if persistedVR.RequestStatus == verification.RequestStatusCANCELED {
|
||||||
|
return nil // Do nothing, We have already cancelled the verification request
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
persistedVR.RequestStatus = verification.RequestStatusACCEPTED
|
persistedVR.RequestStatus = verification.RequestStatusACCEPTED
|
||||||
|
|
Loading…
Reference in New Issue