mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-17 15:33:30 +01:00
Use global config for admin delete timer.
This commit is contained in:
committed by
Greyson Parrelli
parent
0acb5ac7cd
commit
1e395ab416
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user