import org.whispersystems.signalservice.api.messages.SignalServiceContent;
import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
-import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
import org.whispersystems.signalservice.internal.contacts.crypto.UnauthenticatedResponseException;
void setRegistrationLockPin(Optional<String> pin) throws IOException, UnauthenticatedResponseException;
- Profile getRecipientProfile(RecipientIdentifier.Single recipient) throws UnregisteredUserException;
+ Profile getRecipientProfile(RecipientIdentifier.Single recipient) throws IOException;
List<Group> getGroups();
void setContactName(
RecipientIdentifier.Single recipient, String name
- ) throws NotMasterDeviceException, UnregisteredUserException;
+ ) throws NotMasterDeviceException, IOException;
void setContactBlocked(
RecipientIdentifier.Single recipient, boolean blocked
import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage;
import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
-import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.signalservice.api.util.DeviceNameUtil;
import org.whispersystems.signalservice.api.util.InvalidNumberException;
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
}
@Override
- public Profile getRecipientProfile(RecipientIdentifier.Single recipient) throws UnregisteredUserException {
+ public Profile getRecipientProfile(RecipientIdentifier.Single recipient) throws IOException {
return profileHelper.getRecipientProfile(resolveRecipient(recipient));
}
@Override
public void setContactName(
RecipientIdentifier.Single recipient, String name
- ) throws NotMasterDeviceException, UnregisteredUserException {
+ ) throws NotMasterDeviceException, IOException {
if (!account.isMasterDevice()) {
throw new NotMasterDeviceException();
}
try {
uuidMap = getRegisteredUsers(Set.of(number));
} catch (NumberFormatException e) {
- throw new UnregisteredUserException(number, e);
+ throw new IOException(number, e);
}
final var uuid = uuidMap.get(number);
if (uuid == null) {
- throw new UnregisteredUserException(number, null);
+ throw new IOException(number, null);
}
return uuid;
}
final RecipientId recipientId;
try {
recipientId = resolveRecipient(recipient);
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
return false;
}
return contactHelper.isContactBlocked(recipientId);
final RecipientId recipientId;
try {
recipientId = resolveRecipient(recipient);
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
return null;
}
IdentityInfo identity;
try {
identity = account.getIdentityKeyStore().getIdentity(resolveRecipient(recipient));
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
identity = null;
}
return identity == null ? List.of() : List.of(toIdentity(identity));
RecipientId recipientId;
try {
recipientId = resolveRecipient(recipient);
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
return false;
}
return identityHelper.trustIdentityVerified(recipientId, fingerprint);
RecipientId recipientId;
try {
recipientId = resolveRecipient(recipient);
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
return false;
}
return identityHelper.trustIdentityVerifiedSafetyNumber(recipientId, safetyNumber);
RecipientId recipientId;
try {
recipientId = resolveRecipient(recipient);
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
return false;
}
return identityHelper.trustIdentityVerifiedSafetyNumber(recipientId, safetyNumber);
RecipientId recipientId;
try {
recipientId = resolveRecipient(recipient);
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
return false;
}
return identityHelper.trustIdentityAllKeys(recipientId);
return resolveSignalServiceAddress(account.getRecipientStore().resolveRecipient(uuid));
}
- private Set<RecipientId> resolveRecipients(Collection<RecipientIdentifier.Single> recipients) throws UnregisteredUserException {
+ private Set<RecipientId> resolveRecipients(Collection<RecipientIdentifier.Single> recipients) throws IOException {
final var recipientIds = new HashSet<RecipientId>(recipients.size());
for (var number : recipients) {
final var recipientId = resolveRecipient(number);
return recipientIds;
}
- private RecipientId resolveRecipient(final RecipientIdentifier.Single recipient) throws UnregisteredUserException {
+ private RecipientId resolveRecipient(final RecipientIdentifier.Single recipient) throws IOException {
if (recipient instanceof RecipientIdentifier.Uuid) {
return account.getRecipientStore().resolveRecipient(((RecipientIdentifier.Uuid) recipient).uuid);
} else {
import org.freedesktop.dbus.exceptions.DBusExecutionException;
import org.freedesktop.dbus.types.Variant;
import org.whispersystems.signalservice.api.messages.SendMessageResult;
-import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.signalservice.api.util.InvalidNumberException;
import org.whispersystems.signalservice.internal.contacts.crypto.UnauthenticatedResponseException;
m.setContactName(getSingleRecipientIdentifier(number, m.getSelfNumber()), name);
} catch (NotMasterDeviceException e) {
throw new Error.Failure("This command doesn't work on linked devices.");
- } catch (UnregisteredUserException e) {
+ } catch (IOException e) {
throw new Error.Failure("Contact is not registered.");
}
}
Profile profile = null;
try {
profile = m.getRecipientProfile(RecipientIdentifier.Single.fromAddress(address));
- } catch (UnregisteredUserException ignored) {
+ } catch (IOException ignored) {
}
if (profile != null && profile.getDisplayName().equals(name)) {
numbers.add(number);