mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 23:57:32 +00:00
Enforce a configurable max envelope size.
This commit is contained in:

committed by
Cody Henthorne

parent
ac54b5cbdf
commit
f676d1c61c
@@ -99,7 +99,8 @@ public class ApplicationDependencyProvider implements ApplicationDependencies.Pr
|
||||
Optional.fromNullable(IncomingMessageObserver.getUnidentifiedPipe()),
|
||||
Optional.of(new SecurityEventListener(context)),
|
||||
provideClientZkOperations().getProfileOperations(),
|
||||
SignalExecutors.newCachedBoundedExecutor("signal-messages", 1, 16));
|
||||
SignalExecutors.newCachedBoundedExecutor("signal-messages", 1, 16),
|
||||
FeatureFlags.maxEnvelopeSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -60,6 +60,7 @@ public final class FeatureFlags {
|
||||
public static final String RESEARCH_MEGAPHONE_1 = "research.megaphone.1";
|
||||
public static final String MODERN_PROFILE_SHARING = "android.modernProfileSharing";
|
||||
private static final String VIEWED_RECEIPTS = "android.viewed.receipts";
|
||||
private static final String MAX_ENVELOPE_SIZE = "android.maxEnvelopeSize";
|
||||
|
||||
/**
|
||||
* We will only store remote values for flags in this set. If you want a flag to be controllable
|
||||
@@ -77,7 +78,8 @@ public final class FeatureFlags {
|
||||
CLIENT_EXPIRATION,
|
||||
RESEARCH_MEGAPHONE_1,
|
||||
MODERN_PROFILE_SHARING,
|
||||
VIEWED_RECEIPTS
|
||||
VIEWED_RECEIPTS,
|
||||
MAX_ENVELOPE_SIZE
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -245,13 +247,16 @@ public final class FeatureFlags {
|
||||
return getBoolean(MODERN_PROFILE_SHARING, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user should display the content revealed dot in voice notes.
|
||||
*/
|
||||
/** Whether the user should display the content revealed dot in voice notes. */
|
||||
public static boolean viewedReceipts() {
|
||||
return getBoolean(VIEWED_RECEIPTS, false);
|
||||
}
|
||||
|
||||
/** The max size envelope that is allowed to be sent. */
|
||||
public static int maxEnvelopeSize() {
|
||||
return getInteger(MAX_ENVELOPE_SIZE, 0);
|
||||
}
|
||||
|
||||
/** 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