- for (var contactNumber : CommandUtil.getSingleRecipientIdentifiers(ns.getList("recipient"),
- m.getSelfNumber())) {
- try {
- m.setContactBlocked(contactNumber, false);
- } catch (NotMasterDeviceException e) {
- throw new UserErrorException("This command doesn't work on linked devices.");
- } catch (IOException e) {
- throw new UnexpectedErrorException("Failed to sync unblock to linked devices: " + e.getMessage(), e);
- } catch (UnregisteredRecipientException e) {
- throw new UserErrorException("The user " + e.getSender().getIdentifier() + " is not registered.");
- }
+ final var contacts = ns.<String>getList("recipient");
+ final var recipients = CommandUtil.getSingleRecipientIdentifiers(contacts, m.getSelfNumber());
+ try {
+ m.setContactsBlocked(recipients, false);
+ } catch (NotMasterDeviceException e) {
+ throw new UserErrorException("This command doesn't work on linked devices.");
+ } catch (IOException e) {
+ throw new UnexpectedErrorException("Failed to sync unblock to linked devices: " + e.getMessage(), e);
+ } catch (UnregisteredRecipientException e) {
+ throw new UserErrorException("The user " + e.getSender().getIdentifier() + " is not registered.");