mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Rename FeatureFlags -> RemoteConfig.
This commit is contained in:
@@ -89,10 +89,10 @@ import org.thoughtcrime.securesms.recipients.RecipientUtil
|
||||
import org.thoughtcrime.securesms.stickers.StickerLocator
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper
|
||||
import org.thoughtcrime.securesms.util.EarlyMessageCacheEntry
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.LinkUtil
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.thoughtcrime.securesms.util.MessageConstraintsUtil
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.SignalLocalMetrics
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.util.isStory
|
||||
@@ -220,7 +220,7 @@ object DataMessageProcessor {
|
||||
|
||||
if (insertResult != null && insertResult.threadWasNewlyCreated && !threadRecipient.isGroup && !threadRecipient.isSelf && !senderRecipient.isSystemContact) {
|
||||
val timeSinceLastSync = System.currentTimeMillis() - SignalStore.misc().lastCdsForegroundSyncTime
|
||||
if (timeSinceLastSync > FeatureFlags.cdsForegroundSyncInterval || timeSinceLastSync < 0) {
|
||||
if (timeSinceLastSync > RemoteConfig.cdsForegroundSyncInterval || timeSinceLastSync < 0) {
|
||||
log(envelope.timestamp!!, "New 1:1 chat. Scheduling a CDS sync to see if they match someone in our contacts.")
|
||||
AppDependencies.jobManager.add(DirectoryRefreshJob(false))
|
||||
SignalStore.misc().lastCdsForegroundSyncTime = System.currentTimeMillis()
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
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.RemoteConfig;
|
||||
import org.thoughtcrime.securesms.util.RecipientAccessList;
|
||||
import org.thoughtcrime.securesms.util.SignalLocalMetrics;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
@@ -303,7 +303,7 @@ public final class GroupSendUtil {
|
||||
long keyCreateTime = SenderKeyUtil.getCreateTimeForOurKey(distributionId);
|
||||
long keyAge = System.currentTimeMillis() - keyCreateTime;
|
||||
|
||||
if (keyCreateTime != -1 && keyAge > FeatureFlags.senderKeyMaxAge()) {
|
||||
if (keyCreateTime != -1 && keyAge > RemoteConfig.senderKeyMaxAge()) {
|
||||
Log.w(TAG, "DistributionId " + distributionId + " was created at " + keyCreateTime + " and is " + (keyAge) + " ms old (~" + TimeUnit.MILLISECONDS.toDays(keyAge) + " days). Rotating.");
|
||||
SenderKeyUtil.rotateOurKey(distributionId);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.thoughtcrime.securesms.notifications.v2.ConversationId
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.EarlyMessageCacheEntry
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.SignalLocalMetrics
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.util.Util
|
||||
@@ -561,7 +561,7 @@ open class MessageContentProcessor(private val context: Context) {
|
||||
}
|
||||
|
||||
private fun handleRetryReceipt(envelope: Envelope, metadata: EnvelopeMetadata, decryptionErrorMessage: DecryptionErrorMessage, senderRecipient: Recipient) {
|
||||
if (!FeatureFlags.retryReceipts) {
|
||||
if (!RemoteConfig.retryReceipts) {
|
||||
warn(envelope.timestamp!!, "[RetryReceipt] Feature flag disabled, skipping retry receipt.")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ import org.thoughtcrime.securesms.notifications.NotificationChannels
|
||||
import org.thoughtcrime.securesms.notifications.NotificationIds
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.LRUCache
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.asChain
|
||||
import org.whispersystems.signalservice.api.InvalidMessageStructureException
|
||||
import org.whispersystems.signalservice.api.crypto.ContentHint
|
||||
@@ -156,7 +156,7 @@ object MessageDecryptor {
|
||||
if (validationResult is EnvelopeContentValidator.Result.Invalid) {
|
||||
Log.w(TAG, "${logPrefix(envelope, cipherResult)} Invalid content! ${validationResult.reason}", validationResult.throwable)
|
||||
|
||||
if (FeatureFlags.internalUser) {
|
||||
if (RemoteConfig.internalUser) {
|
||||
postInvalidMessageNotification(context, validationResult.reason)
|
||||
}
|
||||
|
||||
@@ -213,11 +213,11 @@ object MessageDecryptor {
|
||||
check(e is ProtocolException)
|
||||
Log.w(TAG, "${logPrefix(envelope, e)} Decryption error!", e, true)
|
||||
|
||||
if (FeatureFlags.internalUser) {
|
||||
if (RemoteConfig.internalUser) {
|
||||
postDecryptionErrorNotification(context)
|
||||
}
|
||||
|
||||
if (FeatureFlags.retryReceipts) {
|
||||
if (RemoteConfig.retryReceipts) {
|
||||
buildResultForDecryptionError(context, envelope, serverDeliveredTimestamp, followUpOperations, e)
|
||||
} else {
|
||||
Log.w(TAG, "${logPrefix(envelope, e)} Retry receipts disabled! Enqueuing a session reset job, which will also insert an error message.", e, true)
|
||||
@@ -296,7 +296,7 @@ object MessageDecryptor {
|
||||
|
||||
val errorCount: DecryptionErrorCount = decryptionErrorCounts.getOrPut(sender.id) { DecryptionErrorCount(count = 0, lastReceivedTime = 0) }
|
||||
val timeSinceLastError = receivedTimestamp - errorCount.lastReceivedTime
|
||||
if (timeSinceLastError > FeatureFlags.retryReceiptMaxCountResetAge && errorCount.count > 0) {
|
||||
if (timeSinceLastError > RemoteConfig.retryReceiptMaxCountResetAge && errorCount.count > 0) {
|
||||
Log.i(TAG, "${logPrefix(envelope, senderServiceId)} Resetting decryption error count for ${sender.id} because it has been $timeSinceLastError ms since the last error.", true)
|
||||
errorCount.count = 0
|
||||
}
|
||||
@@ -304,8 +304,8 @@ object MessageDecryptor {
|
||||
errorCount.count++
|
||||
errorCount.lastReceivedTime = receivedTimestamp
|
||||
|
||||
if (errorCount.count > FeatureFlags.retryReceiptMaxCount) {
|
||||
Log.w(TAG, "${logPrefix(envelope, senderServiceId)} This is error number ${errorCount.count} from ${sender.id}, which is greater than the maximum of ${FeatureFlags.retryReceiptMaxCount}. Ignoring.", true)
|
||||
if (errorCount.count > RemoteConfig.retryReceiptMaxCount) {
|
||||
Log.w(TAG, "${logPrefix(envelope, senderServiceId)} This is error number ${errorCount.count} from ${sender.id}, which is greater than the maximum of ${RemoteConfig.retryReceiptMaxCount}. Ignoring.", true)
|
||||
|
||||
if (contentHint == ContentHint.IMPLICIT) {
|
||||
Log.w(TAG, "${logPrefix(envelope, senderServiceId)} The content hint is $contentHint, so no error message is needed.", true)
|
||||
|
||||
@@ -14,8 +14,8 @@ import org.thoughtcrime.securesms.attachments.PointerAttachment
|
||||
import org.thoughtcrime.securesms.database.model.StoryType
|
||||
import org.thoughtcrime.securesms.groups.GroupId
|
||||
import org.thoughtcrime.securesms.stickers.StickerLocator
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.whispersystems.signalservice.api.InvalidMessageStructureException
|
||||
import org.whispersystems.signalservice.api.crypto.EnvelopeMetadata
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceAttachmentPointer
|
||||
@@ -171,7 +171,7 @@ object SignalServiceProtoUtil {
|
||||
}
|
||||
|
||||
fun List<AttachmentPointer>.toPointersWithinLimit(): List<Attachment> {
|
||||
return mapNotNull { it.toPointer() }.take(FeatureFlags.maxAttachmentCount)
|
||||
return mapNotNull { it.toPointer() }.take(RemoteConfig.maxAttachmentCount)
|
||||
}
|
||||
|
||||
fun AttachmentPointer.toPointer(stickerLocator: StickerLocator? = null): Attachment? {
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.thoughtcrime.securesms.mms.IncomingMessage
|
||||
import org.thoughtcrime.securesms.mms.MmsException
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.stories.Stories
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.whispersystems.signalservice.api.crypto.EnvelopeMetadata
|
||||
import org.whispersystems.signalservice.internal.push.Content
|
||||
import org.whispersystems.signalservice.internal.push.Envelope
|
||||
@@ -90,7 +90,7 @@ object StoryMessageProcessor {
|
||||
}
|
||||
|
||||
if (insertResult != null) {
|
||||
Stories.enqueueNextStoriesForDownload(threadRecipient.id, false, FeatureFlags.storiesAutoDownloadMaximum)
|
||||
Stories.enqueueNextStoriesForDownload(threadRecipient.id, false, RemoteConfig.storiesAutoDownloadMaximum)
|
||||
AppDependencies.expireStoriesManager.scheduleIfNecessary()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +90,10 @@ import org.thoughtcrime.securesms.service.webrtc.links.SignalCallLinkState
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper
|
||||
import org.thoughtcrime.securesms.stories.Stories
|
||||
import org.thoughtcrime.securesms.util.EarlyMessageCacheEntry
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.IdentityUtil
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.thoughtcrime.securesms.util.MessageConstraintsUtil
|
||||
import org.thoughtcrime.securesms.util.RemoteConfig
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.util.Util
|
||||
import org.whispersystems.signalservice.api.crypto.EnvelopeMetadata
|
||||
@@ -1368,7 +1368,7 @@ object SyncMessageProcessor {
|
||||
|
||||
@Throws(BadGroupIdException::class)
|
||||
private fun handleSynchronizeGroupOrAdHocCallEvent(callEvent: SyncMessage.CallEvent, envelopeTimestamp: Long) {
|
||||
if (!FeatureFlags.adHocCalling && callEvent.type == SyncMessage.CallEvent.Type.AD_HOC_CALL) {
|
||||
if (!RemoteConfig.adHocCalling && callEvent.type == SyncMessage.CallEvent.Type.AD_HOC_CALL) {
|
||||
log(envelopeTimestamp, "Ad-Hoc calling is not currently supported by this client, ignoring.")
|
||||
return
|
||||
}
|
||||
@@ -1475,7 +1475,7 @@ object SyncMessageProcessor {
|
||||
}
|
||||
|
||||
private fun handleSynchronizeDeleteForMe(context: Context, deleteForMe: SyncMessage.DeleteForMe, envelopeTimestamp: Long, earlyMessageCacheEntry: EarlyMessageCacheEntry?) {
|
||||
if (!FeatureFlags.deleteSyncEnabled) {
|
||||
if (!RemoteConfig.deleteSyncEnabled) {
|
||||
warn(envelopeTimestamp, "Delete for me sync message dropped as support not enabled")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user