tinyrelayfile
tinyrelay/internal/event/filter.go/

internal/event/filter.go raw
1package event
2
3import "github.com/FelineStateMachine/tinyrelay/protocol/nostr"
4
5// Filter is the public subscription and query value.
6type Filter = nostr.Filter
7
8func ParseFilter(raw []byte) (Filter, error) { return nostr.ParseFilter(raw) }
9func SearchTerms(query string) []string { return nostr.SearchTerms(query) }
10
11// Matches preserves the host's search visibility rule for existing consumers.
12// Generic field, tag and content matching lives in protocol/nostr.
13func Matches(f Filter, e Event) bool {
14 if IsPrivate(e.Kind) && len(nostr.SearchTerms(f.Search)) > 0 {
15 return false
16 }
17 return nostr.Matches(f, e)
18}

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs