Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function for checking if a given Filter matches an Event #318

Closed
dluvian opened this issue Mar 3, 2024 · 0 comments
Closed

Function for checking if a given Filter matches an Event #318

dluvian opened this issue Mar 3, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dluvian
Copy link
Contributor

dluvian commented Mar 3, 2024

Describe the enhancement

A function that checks if an Event can be queried by a given Filter. Something like Filter::matches(event: &Event) -> Boolean and expose it to the Kotlin bindings. Or at least let Kotlin nostr binding users retrieve the current value of each field of the Filter, so users can implement the matches function themselves. The exposed functions are setters, no getters.

Use case

Clients should always check if the received events are really the ones we queried for. Otherwise malicious or buggy relays could spam the client with unwanted events

Additional context

@dluvian dluvian added the enhancement New feature or request label Mar 3, 2024
@yukibtc yukibtc added this to the Release v0.29 milestone Mar 3, 2024
@yukibtc yukibtc self-assigned this Mar 12, 2024
yukibtc added a commit that referenced this issue Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants