mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-08-15 09:43:22 +01:00
Ensure envelope model updates info from metadata.
In practice this doesn't really matter because we don't read from it after this point, but good to be consistent.
This commit is contained in:
@@ -156,6 +156,15 @@ object MessageDecryptor {
|
||||
val cipherResult: SignalServiceCipherResult? = cipher.decrypt(envelope, serverDeliveredTimestamp)
|
||||
val endTimeNanos = System.nanoTime()
|
||||
|
||||
val envelope = if (cipherResult?.metadata?.sourceServiceId != null) {
|
||||
envelope.newBuilder()
|
||||
.sourceServiceId(cipherResult.metadata.sourceServiceId.toString())
|
||||
.sourceDevice(cipherResult.metadata.sourceDeviceId)
|
||||
.build()
|
||||
} else {
|
||||
envelope
|
||||
}
|
||||
|
||||
if (cipherResult == null) {
|
||||
Log.w(TAG, "${logPrefix(envelope)} Decryption resulted in a null result!", true)
|
||||
return Result.Ignore(envelope, serverDeliveredTimestamp, followUpOperations.toUnmodifiableList())
|
||||
|
||||
Reference in New Issue
Block a user