Skip to content
This repository was archived by the owner on Jan 24, 2026. It is now read-only.

Commit 04b6cbc

Browse files
committed
filter search
1 parent 18369d4 commit 04b6cbc

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

filter.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package nostr
22

33
import (
44
"slices"
5+
"strings"
56

67
"github.com/mailru/easyjson"
78
)
@@ -91,6 +92,14 @@ func (ef Filter) MatchesIgnoringTimestampConstraints(event *Event) bool {
9192
}
9293
}
9394

95+
if ef.Search != "" && event.Content != "" {
96+
for _, word := range strings.Split(ef.Search, " ") {
97+
if strings.Contains(event.Content, word) {
98+
return true
99+
}
100+
}
101+
}
102+
94103
return true
95104
}
96105

0 commit comments

Comments
 (0)