mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-08 20:08:06 +02:00
increases the time to notify to 15 minutes
This commit is contained in:
parent
fa4745038f
commit
75ac17b57d
@ -108,7 +108,7 @@ class EventNotificationConsumer(private val applicationContext: Context) {
|
||||
acc: Account,
|
||||
) {
|
||||
if (
|
||||
event.createdAt > TimeUtils.fiveMinutesAgo() && // old event being re-broadcasted
|
||||
event.createdAt > TimeUtils.fifteenMinutesAgo() && // old event being re-broadcasted
|
||||
event.pubKey != acc.userProfile().pubkeyHex
|
||||
) { // from the user
|
||||
|
||||
@ -148,7 +148,7 @@ class EventNotificationConsumer(private val applicationContext: Context) {
|
||||
val note = LocalCache.getNoteIfExists(event.id) ?: return
|
||||
|
||||
// old event being re-broadcast
|
||||
if (event.createdAt < TimeUtils.fiveMinutesAgo()) return
|
||||
if (event.createdAt < TimeUtils.fifteenMinutesAgo()) return
|
||||
|
||||
if (acc.userProfile().pubkeyHex == event.verifiedRecipientPubKey()) {
|
||||
val followingKeySet = acc.followingKeySet()
|
||||
@ -187,7 +187,7 @@ class EventNotificationConsumer(private val applicationContext: Context) {
|
||||
val noteZapEvent = LocalCache.getNoteIfExists(event.id) ?: return
|
||||
|
||||
// old event being re-broadcast
|
||||
if (event.createdAt < TimeUtils.fiveMinutesAgo()) return
|
||||
if (event.createdAt < TimeUtils.fifteenMinutesAgo()) return
|
||||
|
||||
val noteZapRequest = event.zapRequest?.id?.let { LocalCache.checkGetOrCreateNote(it) } ?: return
|
||||
val noteZapped =
|
||||
@ -195,7 +195,7 @@ class EventNotificationConsumer(private val applicationContext: Context) {
|
||||
|
||||
if ((event.amount ?: BigDecimal.ZERO) < BigDecimal.TEN) return
|
||||
|
||||
if (acc.userProfile().pubkeyHex == event.zappedAuthor().firstOrNull()) {
|
||||
if (event.isTaggedUser(acc.userProfile().pubkeyHex)) {
|
||||
val amount = showAmount(event.amount)
|
||||
(noteZapRequest.event as? LnZapRequestEvent)?.let { event ->
|
||||
acc.decryptZapContentAuthor(noteZapRequest) {
|
||||
|
@ -25,6 +25,7 @@ import com.vitorpamplona.quartz.crypto.CryptoUtils
|
||||
object TimeUtils {
|
||||
const val ONE_MINUTE = 60
|
||||
const val FIVE_MINUTES = 5 * ONE_MINUTE
|
||||
const val FIFTEEN_MINUTES = 15 * ONE_MINUTE
|
||||
const val ONE_HOUR = 60 * ONE_MINUTE
|
||||
const val EIGHT_HOURS = 8 * ONE_HOUR
|
||||
const val ONE_DAY = 24 * ONE_HOUR
|
||||
@ -40,6 +41,8 @@ object TimeUtils {
|
||||
|
||||
fun fiveMinutesAgo() = now() - FIVE_MINUTES
|
||||
|
||||
fun fifteenMinutesAgo() = now() - FIFTEEN_MINUTES
|
||||
|
||||
fun oneHourAgo() = now() - ONE_HOUR
|
||||
|
||||
fun oneHourAhead() = now() + ONE_HOUR
|
||||
|
Loading…
x
Reference in New Issue
Block a user