mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-26 23:33:22 +01:00
Server side support for delivery receipts.
This commit is contained in:
@@ -41,7 +41,7 @@ public class IncomingMessage {
|
||||
private String relay;
|
||||
|
||||
@JsonProperty
|
||||
private long timestamp;
|
||||
private long timestamp; // deprecated
|
||||
|
||||
|
||||
public String getDestination() {
|
||||
|
||||
@@ -32,6 +32,9 @@ public class IncomingMessageList {
|
||||
@JsonProperty
|
||||
private String relay;
|
||||
|
||||
@JsonProperty
|
||||
private long timestamp;
|
||||
|
||||
public IncomingMessageList() {}
|
||||
|
||||
public List<IncomingMessage> getMessages() {
|
||||
@@ -45,4 +48,8 @@ public class IncomingMessageList {
|
||||
public void setRelay(String relay) {
|
||||
this.relay = relay;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,11 +13,15 @@ public class PendingMessage {
|
||||
@JsonProperty
|
||||
private String encryptedOutgoingMessage;
|
||||
|
||||
@JsonProperty
|
||||
private boolean receipt;
|
||||
|
||||
public PendingMessage() {}
|
||||
|
||||
public PendingMessage(String sender, long messageId, String encryptedOutgoingMessage) {
|
||||
public PendingMessage(String sender, long messageId, boolean receipt, String encryptedOutgoingMessage) {
|
||||
this.sender = sender;
|
||||
this.messageId = messageId;
|
||||
this.receipt = receipt;
|
||||
this.encryptedOutgoingMessage = encryptedOutgoingMessage;
|
||||
}
|
||||
|
||||
@@ -33,6 +37,10 @@ public class PendingMessage {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public boolean isReceipt() {
|
||||
return receipt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == null || !(other instanceof PendingMessage)) return false;
|
||||
@@ -41,11 +49,12 @@ public class PendingMessage {
|
||||
return
|
||||
this.sender.equals(that.sender) &&
|
||||
this.messageId == that.messageId &&
|
||||
this.receipt == that.receipt &&
|
||||
this.encryptedOutgoingMessage.equals(that.encryptedOutgoingMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.sender.hashCode() ^ (int)this.messageId ^ this.encryptedOutgoingMessage.hashCode();
|
||||
return this.sender.hashCode() ^ (int)this.messageId ^ this.encryptedOutgoingMessage.hashCode() ^ (receipt ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user