mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add --ignore-stories flag to prevent receiving story messages
This commit is contained in:
parent
3f7d8c60b9
commit
9ffacfe90e
8 changed files with 51 additions and 20 deletions
|
@ -79,6 +79,9 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
|
|||
subparser.addArgument("--ignore-attachments")
|
||||
.help("Don’t download attachments of received messages.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--ignore-stories")
|
||||
.help("Don’t receive story messages from the server.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--send-read-receipts")
|
||||
.help("Send read receipts for all incoming data messages (in addition to the default delivery receipts)")
|
||||
.action(Arguments.storeTrue());
|
||||
|
@ -97,9 +100,10 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
|
|||
final var noReceiveStdOut = Boolean.TRUE.equals(ns.getBoolean("no-receive-stdout"));
|
||||
final var receiveMode = ns.<ReceiveMode>get("receive-mode");
|
||||
final var ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
|
||||
final boolean sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
final var ignoreStories = Boolean.TRUE.equals(ns.getBoolean("ignore-stories"));
|
||||
final var sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
|
||||
m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, sendReadReceipts));
|
||||
m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, ignoreStories, sendReadReceipts));
|
||||
addDefaultReceiveHandler(m, noReceiveStdOut ? null : outputWriter, receiveMode != ReceiveMode.ON_START);
|
||||
|
||||
final Channel inheritedChannel;
|
||||
|
@ -160,9 +164,10 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
|
|||
final var noReceiveStdOut = Boolean.TRUE.equals(ns.getBoolean("no-receive-stdout"));
|
||||
final var receiveMode = ns.<ReceiveMode>get("receive-mode");
|
||||
final var ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
|
||||
final boolean sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
final var ignoreStories = Boolean.TRUE.equals(ns.getBoolean("ignore-stories"));
|
||||
final var sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
|
||||
final var receiveConfig = new ReceiveConfig(ignoreAttachments, sendReadReceipts);
|
||||
final var receiveConfig = new ReceiveConfig(ignoreAttachments, ignoreStories, sendReadReceipts);
|
||||
c.getManagers().forEach(m -> {
|
||||
m.setReceiveConfig(receiveConfig);
|
||||
addDefaultReceiveHandler(m, noReceiveStdOut ? null : outputWriter, receiveMode != ReceiveMode.ON_START);
|
||||
|
|
|
@ -34,6 +34,9 @@ public class JsonRpcDispatcherCommand implements LocalCommand {
|
|||
subparser.addArgument("--ignore-attachments")
|
||||
.help("Don’t download attachments of received messages.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--ignore-stories")
|
||||
.help("Don’t receive story messages from the server.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--send-read-receipts")
|
||||
.help("Send read receipts for all incoming data messages (in addition to the default delivery receipts)")
|
||||
.action(Arguments.storeTrue());
|
||||
|
@ -48,9 +51,10 @@ public class JsonRpcDispatcherCommand implements LocalCommand {
|
|||
public void handleCommand(
|
||||
final Namespace ns, final Manager m, final OutputWriter outputWriter
|
||||
) throws CommandException {
|
||||
final boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
|
||||
final boolean sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, sendReadReceipts));
|
||||
final var ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
|
||||
final var ignoreStories = Boolean.TRUE.equals(ns.getBoolean("ignore-stories"));
|
||||
final var sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, ignoreStories, sendReadReceipts));
|
||||
|
||||
final var jsonOutputWriter = (JsonWriter) outputWriter;
|
||||
final Supplier<String> lineSupplier = IOUtils.getLineSupplier(new InputStreamReader(System.in,
|
||||
|
|
|
@ -40,6 +40,9 @@ public class ReceiveCommand implements LocalCommand {
|
|||
subparser.addArgument("--ignore-attachments")
|
||||
.help("Don’t download attachments of received messages.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--ignore-stories")
|
||||
.help("Don’t receive story messages from the server.")
|
||||
.action(Arguments.storeTrue());
|
||||
subparser.addArgument("--send-read-receipts")
|
||||
.help("Send read receipts for all incoming data messages (in addition to the default delivery receipts)")
|
||||
.action(Arguments.storeTrue());
|
||||
|
@ -54,10 +57,11 @@ public class ReceiveCommand implements LocalCommand {
|
|||
public void handleCommand(
|
||||
final Namespace ns, final Manager m, final OutputWriter outputWriter
|
||||
) throws CommandException {
|
||||
double timeout = ns.getDouble("timeout");
|
||||
boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
|
||||
boolean sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, sendReadReceipts));
|
||||
final var timeout = ns.getDouble("timeout");
|
||||
final var ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
|
||||
final var ignoreStories = Boolean.TRUE.equals(ns.getBoolean("ignore-stories"));
|
||||
final var sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
|
||||
m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, ignoreStories, sendReadReceipts));
|
||||
try {
|
||||
final var handler = outputWriter instanceof JsonWriter ? new JsonReceiveMessageHandler(m,
|
||||
(JsonWriter) outputWriter) : new ReceiveMessageHandler(m, (PlainTextWriter) outputWriter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue