mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89f11e214d | ||
|
|
bb09e25512 |
@@ -1,6 +1,6 @@
|
||||
export function matchFilter(filter, event) {
|
||||
if (filter.ids && filter.ids.indexOf(event.id) !== -1) return false
|
||||
if (filter.kinds && filter.kinds.indexOf(event.kind) !== -1) return false
|
||||
if (filter.ids && filter.ids.indexOf(event.id) === -1) return false
|
||||
if (filter.kinds && filter.kinds.indexOf(event.kind) === -1) return false
|
||||
if (filter.authors && filter.authors.indexOf(event.pubkey) === -1)
|
||||
return false
|
||||
|
||||
@@ -8,7 +8,9 @@ export function matchFilter(filter, event) {
|
||||
if (f[0] === '#') {
|
||||
if (
|
||||
filter[f] &&
|
||||
!event.tags.find(([t, v]) => t === f.slice(1) && v === filter[f])
|
||||
!event.tags.find(
|
||||
([t, v]) => t === f.slice(1) && filter[f].indexOf(v) !== -1
|
||||
)
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nostr-tools",
|
||||
"version": "0.16.0",
|
||||
"version": "0.16.2",
|
||||
"description": "Tools for making a Nostr client.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Reference in New Issue
Block a user