mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +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
|
@ -4,6 +4,7 @@ import net.sourceforge.argparse4j.impl.Arguments;
|
|||
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;
|
||||
|
@ -66,6 +67,8 @@ public class SendReactionCommand implements LocalCommand {
|
|||
final long targetTimestamp = ns.getLong("target_timestamp");
|
||||
|
||||
try {
|
||||
final var writer = new PlainTextWriterImpl(System.out);
|
||||
|
||||
final Pair<Long, List<SendMessageResult>> results;
|
||||
if (groupIdString != null) {
|
||||
var groupId = Util.decodeGroupId(groupIdString);
|
||||
|
@ -73,7 +76,7 @@ public class SendReactionCommand implements LocalCommand {
|
|||
} else {
|
||||
results = m.sendMessageReaction(emoji, isRemove, targetAuthor, targetTimestamp, recipients);
|
||||
}
|
||||
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