Use global config for admin delete timer.

This commit is contained in:
Michelle Tang
2026-03-03 17:43:08 -05:00
committed by Greyson Parrelli
parent 0acb5ac7cd
commit 1e395ab416
2 changed files with 7 additions and 6 deletions

View File

@@ -7,15 +7,16 @@ import org.thoughtcrime.securesms.recipients.Recipient
import org.thoughtcrime.securesms.recipients.RecipientId
import kotlin.time.Duration.Companion.days
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.seconds
/**
* Helpers for determining if a message send/receive is valid for those that
* have strict time limits.
*/
object MessageConstraintsUtil {
private val SEND_THRESHOLD = RemoteConfig.regularDeleteThreshold.milliseconds.inWholeMilliseconds
private val SEND_THRESHOLD = RemoteConfig.regularDeleteThreshold.seconds.inWholeMilliseconds
private val RECEIVE_THRESHOLD = SEND_THRESHOLD + 1.days.inWholeMilliseconds
private val ADMIN_SEND_THRESHOLD = RemoteConfig.adminDeleteThreshold.milliseconds.inWholeMilliseconds
private val ADMIN_SEND_THRESHOLD = RemoteConfig.adminDeleteThreshold.seconds.inWholeMilliseconds
private val ADMIN_RECEIVE_THRESHOLD = ADMIN_SEND_THRESHOLD + 1.days.inWholeMilliseconds
const val MAX_EDIT_COUNT = 10

View File

@@ -1285,8 +1285,8 @@ object RemoteConfig {
@JvmStatic
@get:JvmName("regularDeleteThreshold")
val regularDeleteThreshold: Long by remoteLong(
key = "android.regularDeleteThreshold",
defaultValue = 1.days.inWholeMilliseconds,
key = "global.normalDeleteMaxAgeInSeconds",
defaultValue = 1.days.inWholeSeconds,
hotSwappable = true
)
@@ -1296,8 +1296,8 @@ object RemoteConfig {
@JvmStatic
@get:JvmName("adminDeleteThreshold")
val adminDeleteThreshold: Long by remoteLong(
key = "android.adminDeleteThreshold",
defaultValue = 1.days.inWholeMilliseconds,
key = "global.adminDeleteMaxAgeInSeconds",
defaultValue = 1.days.inWholeSeconds,
hotSwappable = true
)
// endregion