Do a timestamp comparison on unregister events.

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2014-12-03 11:09:01 -08:00
parent ac96f906b3
commit b802994809
3 changed files with 36 additions and 6 deletions

View File

@@ -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;
}
}