mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 15:37:32 +00:00
Add new VIEWED item in RecieptMessage enumeration.
Also includes necessary Database changes for supporting this as well as View-Once receipt support.
This commit is contained in:
@@ -534,6 +534,7 @@ public class SignalServiceMessageSender {
|
||||
|
||||
if (message.isDeliveryReceipt()) builder.setType(ReceiptMessage.Type.DELIVERY);
|
||||
else if (message.isReadReceipt()) builder.setType(ReceiptMessage.Type.READ);
|
||||
else if (message.isViewedReceipt()) builder.setType(ReceiptMessage.Type.VIEWED);
|
||||
|
||||
return container.setReceiptMessage(builder).build().toByteArray();
|
||||
}
|
||||
|
@@ -632,6 +632,7 @@ public final class SignalServiceContent {
|
||||
|
||||
if (content.getType() == SignalServiceProtos.ReceiptMessage.Type.DELIVERY) type = SignalServiceReceiptMessage.Type.DELIVERY;
|
||||
else if (content.getType() == SignalServiceProtos.ReceiptMessage.Type.READ) type = SignalServiceReceiptMessage.Type.READ;
|
||||
else if (content.getType() == SignalServiceProtos.ReceiptMessage.Type.VIEWED) type = SignalServiceReceiptMessage.Type.VIEWED;
|
||||
else type = SignalServiceReceiptMessage.Type.UNKNOWN;
|
||||
|
||||
return new SignalServiceReceiptMessage(type, content.getTimestampList(), metadata.getTimestamp());
|
||||
|
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
public class SignalServiceReceiptMessage {
|
||||
|
||||
public enum Type {
|
||||
UNKNOWN, DELIVERY, READ
|
||||
UNKNOWN, DELIVERY, READ, VIEWED
|
||||
}
|
||||
|
||||
private final Type type;
|
||||
@@ -38,4 +38,8 @@ public class SignalServiceReceiptMessage {
|
||||
public boolean isReadReceipt() {
|
||||
return type == Type.READ;
|
||||
}
|
||||
|
||||
public boolean isViewedReceipt() {
|
||||
return type == Type.VIEWED;
|
||||
}
|
||||
}
|
||||
|
@@ -279,6 +279,7 @@ message ReceiptMessage {
|
||||
enum Type {
|
||||
DELIVERY = 0;
|
||||
READ = 1;
|
||||
VIEWED = 2;
|
||||
}
|
||||
|
||||
optional Type type = 1;
|
||||
|
Reference in New Issue
Block a user