package org.asamk.signal.manager.api;
-public record ReceiveConfig(boolean ignoreAttachments) {}
+public record ReceiveConfig(boolean ignoreAttachments, boolean sendReadReceipts) {}
actions.add(new SendProfileKeyAction(sender));
}
}
+ if (receiveConfig.sendReadReceipts()) {
+ actions.add(new SendReceiptAction(sender,
+ SignalServiceReceiptMessage.Type.READ,
+ message.getTimestamp()));
+ }
actions.addAll(handleSignalServiceDataMessage(message,
false,
private final SignalDependencies dependencies;
private final Context context;
- private ReceiveConfig receiveConfig = new ReceiveConfig(false);
+ private ReceiveConfig receiveConfig = new ReceiveConfig(false, false);
private boolean needsToRetryFailedMessages = false;
private boolean hasCaughtUpWithOldMessages = false;
private boolean isWaitingForMessage = false;
*--ignore-attachments*::
Don’t download attachments of received messages.
+*--send-read-receipts*::
+Send read receipts for all incoming data messages (in addition to the default delivery receipts)
+
=== joinGroup
Join a group via an invitation link.
*--ignore-attachments*::
Don’t download attachments of received messages.
+*--send-read-receipts*::
+Send read receipts for all incoming data messages (in addition to the default delivery receipts)
+
*--no-receive-stdout*::
Don’t print received messages to stdout.
subparser.addArgument("--ignore-attachments")
.help("Don’t download attachments of received messages.")
.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());
}
@Override
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"));
- m.setReceiveConfig(new ReceiveConfig(ignoreAttachments));
+ m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, sendReadReceipts));
addDefaultReceiveHandler(m, noReceiveStdOut ? null : outputWriter, receiveMode != ReceiveMode.ON_START);
final Channel inheritedChannel;
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 receiveConfig = new ReceiveConfig(ignoreAttachments);
+ final var receiveConfig = new ReceiveConfig(ignoreAttachments, sendReadReceipts);
c.getManagers().forEach(m -> {
m.setReceiveConfig(receiveConfig);
addDefaultReceiveHandler(m, noReceiveStdOut ? null : outputWriter, receiveMode != ReceiveMode.ON_START);
subparser.addArgument("--ignore-attachments")
.help("Don’t download attachments of received messages.")
.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());
}
@Override
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
final boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
- m.setReceiveConfig(new ReceiveConfig(ignoreAttachments));
+ final boolean sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
+ m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, sendReadReceipts));
final var jsonOutputWriter = (JsonWriter) outputWriter;
final Supplier<String> lineSupplier = IOUtils.getLineSupplier(new InputStreamReader(System.in,
subparser.addArgument("--ignore-attachments")
.help("Don’t download attachments of received messages.")
.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());
}
@Override
) throws CommandException {
double timeout = ns.getDouble("timeout");
boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
- m.setReceiveConfig(new ReceiveConfig(ignoreAttachments));
+ boolean sendReadReceipts = Boolean.TRUE.equals(ns.getBoolean("send-read-receipts"));
+ m.setReceiveConfig(new ReceiveConfig(ignoreAttachments, sendReadReceipts));
try {
final var handler = outputWriter instanceof JsonWriter ? new JsonReceiveMessageHandler(m,
(JsonWriter) outputWriter) : new ReceiveMessageHandler(m, (PlainTextWriter) outputWriter);