mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-26 05:18:06 +01:00
Do a timestamp comparison on unregister events.
// FREEBIE
This commit is contained in:
@@ -22,8 +22,6 @@ import org.whispersystems.textsecuregcm.auth.AuthenticationCredentials;
|
||||
import org.whispersystems.textsecuregcm.entities.SignedPreKey;
|
||||
import org.whispersystems.textsecuregcm.util.Util;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Device {
|
||||
|
||||
public static final long MASTER_ID = 1;
|
||||
@@ -46,6 +44,9 @@ public class Device {
|
||||
@JsonProperty
|
||||
private String apnId;
|
||||
|
||||
@JsonProperty
|
||||
private long pushTimestamp;
|
||||
|
||||
@JsonProperty
|
||||
private boolean fetchesMessages;
|
||||
|
||||
@@ -79,6 +80,10 @@ public class Device {
|
||||
|
||||
public void setApnId(String apnId) {
|
||||
this.apnId = apnId;
|
||||
|
||||
if (apnId != null) {
|
||||
this.pushTimestamp = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
public String getGcmId() {
|
||||
@@ -87,6 +92,10 @@ public class Device {
|
||||
|
||||
public void setGcmId(String gcmId) {
|
||||
this.gcmId = gcmId;
|
||||
|
||||
if (gcmId != null) {
|
||||
this.pushTimestamp = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
@@ -145,4 +154,8 @@ public class Device {
|
||||
public void setSignedPreKey(SignedPreKey signedPreKey) {
|
||||
this.signedPreKey = signedPreKey;
|
||||
}
|
||||
|
||||
public long getPushTimestamp() {
|
||||
return pushTimestamp;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user