Hide future notes from timeline

Changelog-Fixed: Hide future notes from timeline

Closes: https://github.com/damus-io/damus/issues/2949
Signed-off-by: Terry Yiu <git@tyiu.xyz>
This commit is contained in:
2025-04-07 21:42:31 -04:00
committed by Daniel D’Aquino
parent e7fe4ab9b4
commit 33150a42c5
3 changed files with 19 additions and 2 deletions

View File

@@ -41,7 +41,10 @@ class NotificationFilter: ObservableObject, Equatable {
if let item = item.filter({ ev in
self.friend_filter.filter(contacts: contacts, pubkey: ev.pubkey) &&
(!hellthread_notifications_disabled || !ev.is_hellthread(max_pubkeys: hellthread_notification_max_pubkeys))
(!hellthread_notifications_disabled || !ev.is_hellthread(max_pubkeys: hellthread_notification_max_pubkeys)) &&
// Allow notes that are created no more than 3 seconds in the future
// to account for natural clock skew between sender and receiver.
ev.age >= -3
}) {
acc.append(item)
}