Include e164 in account creation (whoami) responses
This commit is contained in:
parent
fc1465c05d
commit
2866f1b213
|
@ -389,7 +389,7 @@ public class AccountController {
|
||||||
.record(Instant.now().toEpochMilli() - storedVerificationCode.get().getTimestamp(), TimeUnit.MILLISECONDS);
|
.record(Instant.now().toEpochMilli() - storedVerificationCode.get().getTimestamp(), TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AccountCreationResult(account.getUuid(), existingAccount.map(Account::isStorageSupported).orElse(false));
|
return new AccountCreationResult(account.getUuid(), account.getNumber(), existingAccount.map(Account::isStorageSupported).orElse(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Timed
|
@Timed
|
||||||
|
@ -556,7 +556,7 @@ public class AccountController {
|
||||||
@Path("/whoami")
|
@Path("/whoami")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public AccountCreationResult whoAmI(@Auth AuthenticatedAccount auth) {
|
public AccountCreationResult whoAmI(@Auth AuthenticatedAccount auth) {
|
||||||
return new AccountCreationResult(auth.getAccount().getUuid(), auth.getAccount().isStorageSupported());
|
return new AccountCreationResult(auth.getAccount().getUuid(), auth.getAccount().getNumber(), auth.getAccount().isStorageSupported());
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package org.whispersystems.textsecuregcm.entities;
|
package org.whispersystems.textsecuregcm.entities;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials;
|
import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials;
|
||||||
|
@ -14,15 +15,22 @@ import java.util.UUID;
|
||||||
public class AccountCreationResult {
|
public class AccountCreationResult {
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private UUID uuid;
|
private final UUID uuid;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private boolean storageCapable;
|
private final String number;
|
||||||
|
|
||||||
public AccountCreationResult() {}
|
@JsonProperty
|
||||||
|
private final boolean storageCapable;
|
||||||
|
|
||||||
public AccountCreationResult(UUID uuid, boolean storageCapable) {
|
@JsonCreator
|
||||||
this.uuid = uuid;
|
public AccountCreationResult(
|
||||||
|
@JsonProperty("uuid") final UUID uuid,
|
||||||
|
@JsonProperty("number") final String number,
|
||||||
|
@JsonProperty("storageCapable") final boolean storageCapable) {
|
||||||
|
|
||||||
|
this.uuid = uuid;
|
||||||
|
this.number = number;
|
||||||
this.storageCapable = storageCapable;
|
this.storageCapable = storageCapable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +38,10 @@ public class AccountCreationResult {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNumber() {
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isStorageCapable() {
|
public boolean isStorageCapable() {
|
||||||
return storageCapable;
|
return storageCapable;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue