mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-30 00:41:12 +00:00
Re-apply filter when fetching events
This commit is contained in:
parent
44365bf823
commit
6d0c7c796f
@ -1,18 +1,12 @@
|
||||
# Current
|
||||
|
||||
- Cmd -> EventBuilder
|
||||
- Create new "command" module that wraps event builder + outbox + any local anonymous state
|
||||
- Move getUserRelays, getUserMutes etc back to user module?
|
||||
|
||||
- [ ] Refactor
|
||||
- [ ] Move system initialization to app/system
|
||||
- [ ] Delete messages when leaving a room
|
||||
- [ ] Add pagination to chat/dms
|
||||
- [ ] Fix scrolling to to when modal is open
|
||||
- [ ] Take connection health into account when building hints
|
||||
- [ ] Re-apply filter to get rid of unwanted events
|
||||
- [ ] Test migration
|
||||
- [ ] Improve watchers so users of system don't need to know how they work
|
||||
- [ ] Remove external dependencies
|
||||
- [ ] Check for TODOs
|
||||
- [ ] Add custom emoji support
|
||||
- [ ] Re-work note media
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type {Filter} from "nostr-tools"
|
||||
import type {MyEvent} from "src/util/types"
|
||||
import {EventEmitter} from "events"
|
||||
import {verifySignature} from "nostr-tools"
|
||||
import {verifySignature, matchFilters} from "nostr-tools"
|
||||
import {Pool, Plex, Relays, Executor, Socket} from "paravel"
|
||||
import {ensurePlural} from "hurdak/lib/hurdak"
|
||||
import {union, difference} from "src/util/misc"
|
||||
@ -212,7 +212,9 @@ export class Network extends EventEmitter {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: validate that the event we asked for matches the filters we sent
|
||||
if (!matchFilters(filters, event)) {
|
||||
return
|
||||
}
|
||||
|
||||
this.emit("event", {url, event})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user