Add option to send read receipts for all received data messages

Fixes #850
This commit is contained in:
AsamK 2022-05-26 18:00:23 +02:00
parent fd92a96e1a
commit 27dbc671e0
7 changed files with 30 additions and 6 deletions

View file

@ -1,3 +1,3 @@
package org.asamk.signal.manager.api;
public record ReceiveConfig(boolean ignoreAttachments) {}
public record ReceiveConfig(boolean ignoreAttachments, boolean sendReadReceipts) {}

View file

@ -260,6 +260,11 @@ public final class IncomingMessageHandler {
actions.add(new SendProfileKeyAction(sender));
}
}
if (receiveConfig.sendReadReceipts()) {
actions.add(new SendReceiptAction(sender,
SignalServiceReceiptMessage.Type.READ,
message.getTimestamp()));
}
actions.addAll(handleSignalServiceDataMessage(message,
false,

View file

@ -35,7 +35,7 @@ public class ReceiveHelper {
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;