mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 21:47:57 +00:00
Put send viewed receipts behind a feature flag.
This commit is contained in:
@@ -14,6 +14,7 @@ import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.signalservice.api.SignalServiceMessageSender;
|
||||
import org.whispersystems.signalservice.api.crypto.UntrustedIdentityException;
|
||||
@@ -89,7 +90,7 @@ public class SendViewedReceiptJob extends BaseJob {
|
||||
|
||||
@Override
|
||||
public void onRun() throws IOException, UntrustedIdentityException {
|
||||
if (!TextSecurePreferences.isReadReceiptsEnabled(context) || syncTimestamps.isEmpty()) return;
|
||||
if (!TextSecurePreferences.isReadReceiptsEnabled(context) || syncTimestamps.isEmpty() || !FeatureFlags.sendViewedReceipts()) return;
|
||||
|
||||
if (!RecipientUtil.isMessageRequestAccepted(context, threadId)) {
|
||||
Log.w(TAG, "Refusing to send receipts to untrusted recipient");
|
||||
|
@@ -63,6 +63,7 @@ public final class FeatureFlags {
|
||||
private static final String GV1_AUTO_MIGRATE = "android.groupsV1Migration.auto.3";
|
||||
private static final String GV1_MANUAL_MIGRATE = "android.groupsV1Migration.manual";
|
||||
private static final String GV1_FORCED_MIGRATE = "android.groupsV1Migration.forced";
|
||||
private static final String SEND_VIEWED_RECEIPTS = "android.sendViewedReceipts";
|
||||
|
||||
/**
|
||||
* We will only store remote values for flags in this set. If you want a flag to be controllable
|
||||
@@ -81,7 +82,8 @@ public final class FeatureFlags {
|
||||
GV1_AUTO_MIGRATE,
|
||||
GV1_MANUAL_MIGRATE,
|
||||
GV1_FORCED_MIGRATE,
|
||||
GROUP_CALLING
|
||||
GROUP_CALLING,
|
||||
SEND_VIEWED_RECEIPTS
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -244,6 +246,11 @@ public final class FeatureFlags {
|
||||
return getBoolean(GV1_FORCED_MIGRATE, false) && groupsV1ManualMigration() && groupsV1AutoMigration();
|
||||
}
|
||||
|
||||
/** Whether or not to send viewed receipts. */
|
||||
public static boolean sendViewedReceipts() {
|
||||
return getBoolean(SEND_VIEWED_RECEIPTS, false);
|
||||
}
|
||||
|
||||
/** Only for rendering debug info. */
|
||||
public static synchronized @NonNull Map<String, Object> getMemoryValues() {
|
||||
return new TreeMap<>(REMOTE_VALUES);
|
||||
|
Reference in New Issue
Block a user