mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Restrict group names to 32 graphemes.
Uses some code from #10132 hence co-author: Co-authored-by: Fumiaki Yoshimatsu <fumiakiy@gmail.com>
This commit is contained in:
committed by
Greyson Parrelli
parent
0ccc7e3c06
commit
2d39e43677
@@ -14,7 +14,6 @@ import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.SelectionLimits;
|
||||
import org.thoughtcrime.securesms.jobs.RefreshAttributesJob;
|
||||
import org.thoughtcrime.securesms.jobs.RemoteConfigRefreshJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
|
||||
@@ -53,6 +52,7 @@ public final class FeatureFlags {
|
||||
private static final String USERNAMES = "android.usernames";
|
||||
private static final String GROUPS_V2_RECOMMENDED_LIMIT = "global.groupsv2.maxGroupSize";
|
||||
private static final String GROUPS_V2_HARD_LIMIT = "global.groupsv2.groupSizeHardLimit";
|
||||
private static final String GROUP_NAME_MAX_LENGTH = "global.groupsv2.maxNameLength";
|
||||
private static final String INTERNAL_USER = "android.internalUser";
|
||||
private static final String VERIFY_V2 = "android.verifyV2";
|
||||
private static final String PHONE_NUMBER_PRIVACY_VERSION = "android.phoneNumberPrivacyVersion";
|
||||
@@ -89,7 +89,8 @@ public final class FeatureFlags {
|
||||
GROUP_CALLING,
|
||||
SEND_VIEWED_RECEIPTS,
|
||||
CUSTOM_VIDEO_MUXER,
|
||||
CDS_REFRESH_INTERVAL
|
||||
CDS_REFRESH_INTERVAL,
|
||||
GROUP_NAME_MAX_LENGTH
|
||||
);
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -122,7 +123,8 @@ public final class FeatureFlags {
|
||||
GROUP_CALLING,
|
||||
GV1_MIGRATION_JOB,
|
||||
CUSTOM_VIDEO_MUXER,
|
||||
CDS_REFRESH_INTERVAL
|
||||
CDS_REFRESH_INTERVAL,
|
||||
GROUP_NAME_MAX_LENGTH
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -278,6 +280,11 @@ public final class FeatureFlags {
|
||||
return getInteger(CDS_REFRESH_INTERVAL, (int) TimeUnit.HOURS.toSeconds(48));
|
||||
}
|
||||
|
||||
/** The maximum number of grapheme */
|
||||
public static int getMaxGroupNameGraphemeLength() {
|
||||
return Math.max(32, getInteger(GROUP_NAME_MAX_LENGTH, -1));
|
||||
}
|
||||
|
||||
/** 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