mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Do not check if purchase was within last month.
This commit is contained in:
@@ -5,9 +5,6 @@
|
||||
|
||||
package org.signal.core.util.billing
|
||||
|
||||
import kotlin.time.Duration.Companion.days
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
/**
|
||||
* Sealed class hierarchy representing the different success
|
||||
* and error states of google play billing purchases.
|
||||
@@ -21,17 +18,6 @@ sealed interface BillingPurchaseResult {
|
||||
val isAutoRenewing: Boolean
|
||||
) : BillingPurchaseResult {
|
||||
|
||||
/**
|
||||
* @return true if purchaseTime is within the last month.
|
||||
*/
|
||||
fun isWithinTheLastMonth(): Boolean {
|
||||
val now = System.currentTimeMillis().milliseconds
|
||||
val oneMonthAgo = now - 31.days
|
||||
val purchaseTime = this.purchaseTime.milliseconds
|
||||
|
||||
return oneMonthAgo < purchaseTime
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return """
|
||||
BillingPurchaseResult {
|
||||
@@ -40,7 +26,6 @@ sealed interface BillingPurchaseResult {
|
||||
purchaseTime: $purchaseTime
|
||||
isAcknowledged: $isAcknowledged
|
||||
isAutoRenewing: $isAutoRenewing
|
||||
isWithinTheLastMonth: ${isWithinTheLastMonth()}
|
||||
}
|
||||
""".trimIndent()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user