Setting up the boundary for one week ago for notifications

This commit is contained in:
Vitor Pamplona
2025-08-06 13:18:13 -04:00
parent 282935c5f3
commit 1971956443
2 changed files with 3 additions and 3 deletions
@@ -59,7 +59,7 @@ class AccountNotificationsEoseFromInboxRelaysManager(
filterNotificationsToPubkey(
relay = it,
pubkey = user(key).pubkeyHex,
since = since?.get(it)?.time ?: key.feedContentStates.notifications.lastNoteCreatedAtIfFilled(),
since = since?.get(it)?.time ?: key.feedContentStates.notifications.lastNoteCreatedAtIfFilled() ?: TimeUtils.oneWeekAgo(),
)
}
@@ -39,7 +39,7 @@ class AccountNotificationsEoseFromRandomRelaysManager(
client: NostrClient,
allKeys: () -> Set<AccountQueryState>,
) : PerUserEoseManager<AccountQueryState>(client, allKeys) {
override fun user(query: AccountQueryState) = query.account.userProfile()
override fun user(key: AccountQueryState) = key.account.userProfile()
/**
* Downloads most notifications from the user's own inbox relays.
@@ -51,7 +51,7 @@ class AccountNotificationsEoseFromRandomRelaysManager(
since: SincePerRelayMap?,
): List<RelayBasedFilter>? =
(key.account.followsPerRelay.value.keys - key.account.notificationRelays.flow.value).flatMap {
val since = since?.get(it)?.time ?: TimeUtils.oneDayAgo()
val since = since?.get(it)?.time ?: TimeUtils.oneWeekAgo()
filterJustTheLatestNotificationsToPubkeyFromRandomRelays(it, user(key).pubkeyHex, since)
}