Add note provenance filter support to SubscriptionManager

Closes: https://github.com/damus-io/damus/issues/3222
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
Daniel D’Aquino
2025-09-10 17:06:45 -07:00
parent ecbfb3714b
commit 1caad24364
6 changed files with 62 additions and 12 deletions

View File

@@ -27,4 +27,13 @@ extension Ndb {
}
return try self.subscribe(filters: ndbFilters, maxSimultaneousResults: maxSimultaneousResults)
}
/// Determines if a given note was seen on any of the listed relay URLs
func was(noteKey: NoteKey, seenOnAnyOf relayUrls: [RelayURL], txn: SafeNdbTxn<()>? = nil) throws -> Bool {
return try self.was(noteKey: noteKey, seenOnAnyOf: relayUrls.map({ $0.absoluteString }), txn: txn)
}
func process_event(_ str: String, originRelayURL: RelayURL? = nil) -> Bool {
self.process_event(str, originRelayURL: originRelayURL?.absoluteString)
}
}