mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-23 11:15:44 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user