- long timestamp;
- if (groupId != null) {
- timestamp = signal.sendGroupRemoteDeleteMessage(targetTimestamp, groupId);
- } else {
- timestamp = signal.sendRemoteDeleteMessage(targetTimestamp, recipients);
- }
- writer.println("{}", timestamp);
- } catch (AssertionError e) {
- handleAssertionError(e);
- throw e;
- } catch (UnknownObject e) {
- throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
- } catch (Signal.Error.InvalidNumber e) {
- throw new UserErrorException("Invalid number: " + e.getMessage());
- } catch (Signal.Error.GroupNotFound e) {
- throw new UserErrorException("Failed to send to group: " + e.getMessage());
- } catch (DBusExecutionException e) {
- throw new UnexpectedErrorException("Failed to send message: " + e.getMessage());
+ final var results = m.sendRemoteDeleteMessage(targetTimestamp, recipientIdentifiers);
+ outputResult(outputWriter, results);
+ } catch (GroupNotFoundException | NotAGroupMemberException | GroupSendingNotAllowedException e) {
+ throw new UserErrorException(e.getMessage());
+ } catch (IOException e) {
+ throw new UnexpectedErrorException("Failed to send message: " + e.getMessage() + " (" + e.getClass()
+ .getSimpleName() + ")", e);