Refactor out old classes.

This commit is contained in:
Moxie Marlinspike
2014-11-12 09:09:55 -08:00
parent f9934bd8e5
commit f09abff407
16 changed files with 53 additions and 102 deletions

View File

@@ -1,15 +1,18 @@
package org.whispersystems.textsecure.push;
import org.whispersystems.textsecure.storage.RecipientDevice;
public class PushAddress {
public class PushAddress extends RecipientDevice {
public static final int DEFAULT_DEVICE_ID = 1;
private final long recipientId;
private final String e164number;
private final int deviceId;
private final String relay;
public PushAddress(long recipientId, String e164number, int deviceId, String relay) {
super(recipientId, deviceId);
this.recipientId = recipientId;
this.e164number = e164number;
this.deviceId = deviceId;
this.relay = relay;
}
@@ -21,4 +24,11 @@ public class PushAddress extends RecipientDevice {
return relay;
}
public long getRecipientId() {
return recipientId;
}
public int getDeviceId() {
return deviceId;
}
}

View File

@@ -1,6 +0,0 @@
package org.whispersystems.textsecure.storage;
public interface CanonicalRecipient {
// public String getNumber();
public long getRecipientId();
}

View File

@@ -1,31 +0,0 @@
package org.whispersystems.textsecure.storage;
public class RecipientDevice {
public static final int DEFAULT_DEVICE_ID = 1;
private final long recipientId;
private final int deviceId;
public RecipientDevice(long recipientId, int deviceId) {
this.recipientId = recipientId;
this.deviceId = deviceId;
}
public long getRecipientId() {
return recipientId;
}
public int getDeviceId() {
return deviceId;
}
public CanonicalRecipient getRecipient() {
return new CanonicalRecipient() {
@Override
public long getRecipientId() {
return recipientId;
}
};
}
}