+ subparser.addArgument("--note-to-self").action(Arguments.storeTrue());
+ }
+
+ @Override
+ public void handleCommand(
+ final Namespace ns, final Manager m, final OutputWriter outputWriter
+ ) throws CommandException {
+ final var isNoteToSelf = ns.getBoolean("note-to-self");
+ final var recipientStrings = ns.<String>getList("recipient");
+ final var groupIdStrings = ns.<String>getList("group-id");
+
+ final var recipientIdentifiers = CommandUtil.getRecipientIdentifiers(m,
+ isNoteToSelf,
+ recipientStrings,
+ groupIdStrings);
+
+ final long targetTimestamp = ns.getLong("target-timestamp");
+
+ try {
+ final var results = m.sendRemoteDeleteMessage(targetTimestamp, recipientIdentifiers);
+ outputResult(outputWriter, results.getTimestamp());
+ ErrorUtils.handleSendMessageResults(results.getResults());
+ } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ throw new UserErrorException(e.getMessage());
+ } catch (IOException e) {
+ throw new UnexpectedErrorException("Failed to send message: " + e.getMessage());
+ }