- private JsonReceiptMessage(
- final long when, final boolean isDelivery, final boolean isRead, final List<Long> timestamps
- ) {
- this.when = when;
- this.isDelivery = isDelivery;
- this.isRead = isRead;
- this.timestamps = timestamps;
+ static JsonReceiptMessage from(SignalServiceReceiptMessage receiptMessage) {
+ final var when = receiptMessage.getWhen();
+ final var isDelivery = receiptMessage.isDeliveryReceipt();
+ final var isRead = receiptMessage.isReadReceipt();
+ final var isViewed = receiptMessage.isViewedReceipt();
+ final var timestamps = receiptMessage.getTimestamps();
+ return new JsonReceiptMessage(when, isDelivery, isRead, isViewed, timestamps);