- if (ns.<String>getList("group") != null) {
- for (String groupIdString : ns.<String>getList("group")) {
- try {
- byte[] groupId = Util.decodeGroupId(groupIdString);
- m.setGroupBlocked(groupId, false);
- } catch (GroupIdFormatException | GroupNotFoundException e) {
- System.err.println(e.getMessage());
- }
+ final var groupIdStrings = ns.<String>getList("group-id");
+ for (var groupId : CommandUtil.getGroupIds(groupIdStrings)) {
+ try {
+ m.setGroupBlocked(groupId, false);
+ } catch (GroupNotFoundException e) {
+ logger.warn("Unknown group id: {}", groupId);
+ } catch (IOException e) {
+ throw new UnexpectedErrorException("Failed to sync unblock to linked devices: " + e.getMessage(), e);