mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 10:28:12 +01:00
Convert Device.id from long to byte
This commit is contained in:
@@ -10,7 +10,7 @@ import java.util.Base64;
|
||||
|
||||
public class ProvisioningAddress extends WebsocketAddress {
|
||||
|
||||
public ProvisioningAddress(String address, int id) {
|
||||
public ProvisioningAddress(String address, byte id) {
|
||||
super(address, id);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ public class ProvisioningAddress extends WebsocketAddress {
|
||||
byte[] random = new byte[16];
|
||||
new SecureRandom().nextBytes(random);
|
||||
|
||||
return new ProvisioningAddress(Base64.getUrlEncoder().withoutPadding().encodeToString(random), 0);
|
||||
return new ProvisioningAddress(Base64.getUrlEncoder().withoutPadding().encodeToString(random), (byte) 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ import org.whispersystems.textsecuregcm.storage.PubSubAddress;
|
||||
public class WebsocketAddress implements PubSubAddress {
|
||||
|
||||
private final String number;
|
||||
private final long deviceId;
|
||||
private final byte deviceId;
|
||||
|
||||
public WebsocketAddress(String number, long deviceId) {
|
||||
public WebsocketAddress(String number, byte deviceId) {
|
||||
this.number = number;
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class WebsocketAddress implements PubSubAddress {
|
||||
}
|
||||
|
||||
this.number = parts[0];
|
||||
this.deviceId = Long.parseLong(parts[1]);
|
||||
this.deviceId = Byte.parseByte(parts[1]);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new InvalidWebsocketAddressException(e);
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class WebsocketAddress implements PubSubAddress {
|
||||
return number;
|
||||
}
|
||||
|
||||
public long getDeviceId() {
|
||||
public byte getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user