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