Support for multi-device.

1) In addition to the Recipient interface, there is now
   RecipientDevice.  A Recipient can have multiple corresponding
   RecipientDevices.  All addressing is done to a Recipient, but
   crypto sessions and transport delivery are done to
   RecipientDevice.

2) The Push transport handles the discovery and session setup
   of additional Recipient devices.

3) Some internal rejiggering of Groups.
This commit is contained in:
Moxie Marlinspike
2014-02-02 19:38:06 -08:00
parent 49daa45dca
commit 0ace469d74
70 changed files with 1118 additions and 668 deletions

View File

@@ -21,23 +21,17 @@ import org.whispersystems.textsecure.util.Base64;
public class OutgoingPushMessage implements PushMessage {
private int type;
private String destination;
private int destinationDeviceId;
private String body;
private String relay;
public OutgoingPushMessage(String destination, byte[] body, int type) {
this(null, destination, body, type);
public OutgoingPushMessage(PushAddress address, PushBody body) {
this.type = body.getType();
this.destinationDeviceId = address.getDeviceId();
this.body = Base64.encodeBytes(body.getBody());
}
public OutgoingPushMessage(String relay, String destination, byte[] body, int type) {
this.relay = relay;
this.destination = destination;
this.body = Base64.encodeBytes(body);
this.type = type;
}
public String getDestination() {
return destination;
public int getDestinationDeviceId() {
return destinationDeviceId;
}
public String getBody() {
@@ -47,8 +41,4 @@ public class OutgoingPushMessage implements PushMessage {
public int getType() {
return type;
}
public String getRelay() {
return relay;
}
}