From ede0dfeef45cc9fc1dbd952285eb82ad162a7224 Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 26 Jan 2022 21:55:23 +0100 Subject: [PATCH] Fix output for envelope receipts --- .../java/org/asamk/signal/manager/api/MessageEnvelope.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java b/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java index aa34a459..dde8e166 100644 --- a/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java +++ b/lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java @@ -816,7 +816,9 @@ public record MessageEnvelope( .orNull()); call = Optional.ofNullable(content.getCallMessage().transform(Call::from).orNull()); } else { - receipt = Optional.empty(); + receipt = envelope.isReceipt() ? Optional.of(new Receipt(envelope.getServerReceivedTimestamp(), + Receipt.Type.DELIVERY, + List.of(envelope.getTimestamp()))) : Optional.empty(); typing = Optional.empty(); data = Optional.empty(); sync = Optional.empty();