Added ReceiptMessage to JSON output

This commit is contained in:
Gabriel Fernández Valdés 2019-09-23 12:31:55 -04:00 committed by AsamK
parent 625034b2d2
commit 7e267f1ebb
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,25 @@
package org.asamk.signal;
import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage;
import java.util.List;
class JsonReceiptMessage {
long when;
boolean isDelivery;
boolean isRead;
List<Long> timestamps;
JsonReceiptMessage(SignalServiceReceiptMessage receiptMessage) {
this.when = receiptMessage.getWhen();
if (receiptMessage.isDeliveryReceipt()) {
this.isDelivery = true;
}
if (receiptMessage.isReadReceipt()) {
this.isRead = true;
}
this.timestamps = receiptMessage.getTimestamps();
}
}