mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 02:08:40 +00:00
1) At registration time, a client generates a random ID and transmits to the the server. 2) The server provides that registration ID to any client that requests a prekey. 3) Clients include that registration ID in any PreKeyWhisperMessage. 4) Clients include that registration ID in their sendMessage API call to the server. 5) The server verifies that the registration ID included in an API call is the same as the current registration ID for the destination device. Otherwise, it notifies the sender that their session is stale.
27 lines
555 B
Java
27 lines
555 B
Java
package org.whispersystems.textsecure.push;
|
|
|
|
public class PushBody {
|
|
|
|
private final int type;
|
|
private final int remoteRegistrationId;
|
|
private final byte[] body;
|
|
|
|
public PushBody(int type, int remoteRegistrationId, byte[] body) {
|
|
this.type = type;
|
|
this.remoteRegistrationId = remoteRegistrationId;
|
|
this.body = body;
|
|
}
|
|
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
|
|
public byte[] getBody() {
|
|
return body;
|
|
}
|
|
|
|
public int getRemoteRegistrationId() {
|
|
return remoteRegistrationId;
|
|
}
|
|
}
|