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:
Greyson Parrelli
2025-12-15 15:38:50 -05:00
committed by jeffrey-signal
parent 3542c363d9
commit 1bd5b03636

View File

@@ -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())