Canonicalize number when listing identities

This commit is contained in:
AsamK 2020-01-21 22:09:21 +01:00
parent cfd1e5544d
commit 7f9379f78b
2 changed files with 13 additions and 4 deletions

View file

@ -53,6 +53,7 @@ import org.whispersystems.libsignal.state.PreKeyRecord;
import org.whispersystems.libsignal.state.SignedPreKeyRecord;
import org.whispersystems.libsignal.util.KeyHelper;
import org.whispersystems.libsignal.util.Medium;
import org.whispersystems.libsignal.util.Pair;
import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
import org.whispersystems.signalservice.api.SignalServiceMessagePipe;
@ -1545,8 +1546,9 @@ public class Manager implements Signal {
return account.getSignalProtocolStore().getIdentities();
}
public List<JsonIdentityKeyStore.Identity> getIdentities(String number) {
return account.getSignalProtocolStore().getIdentities(number);
public Pair<String, List<JsonIdentityKeyStore.Identity>> getIdentities(String number) throws InvalidNumberException {
String canonicalizedNumber = Utils.canonicalizeNumber(number, username);
return new Pair<>(canonicalizedNumber, account.getSignalProtocolStore().getIdentities(canonicalizedNumber));
}
/**