mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Use PlainTextWriter for all cli stdout output
This commit is contained in:
parent
de273586b4
commit
c6395b9f35
14 changed files with 220 additions and 99 deletions
|
@ -3,6 +3,7 @@ package org.asamk.signal.commands;
|
|||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
import net.sourceforge.argparse4j.inf.Subparser;
|
||||
|
||||
import org.asamk.signal.PlainTextWriterImpl;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.groups.GroupIdFormatException;
|
||||
import org.asamk.signal.manager.groups.GroupNotFoundException;
|
||||
|
@ -28,9 +29,11 @@ public class QuitGroupCommand implements LocalCommand {
|
|||
@Override
|
||||
public int handleCommand(final Namespace ns, final Manager m) {
|
||||
try {
|
||||
final var writer = new PlainTextWriterImpl(System.out);
|
||||
|
||||
final var groupId = Util.decodeGroupId(ns.getString("group"));
|
||||
final var results = m.sendQuitGroupMessage(groupId);
|
||||
return handleTimestampAndSendMessageResults(results.first(), results.second());
|
||||
return handleTimestampAndSendMessageResults(writer, results.first(), results.second());
|
||||
} catch (IOException e) {
|
||||
handleIOException(e);
|
||||
return 3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue