Skip to content

Commit 214371f

Browse files
kehiyfiatjaf
authored andcommitted
refactor(adding): check kind range with proper function.
1 parent fbb40f3 commit 214371f

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

adding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (rl *Relay) AddEvent(ctx context.Context, evt *nostr.Event) (skipBroadcast
2828
}
2929
}
3030

31-
if 20000 <= evt.Kind && evt.Kind < 30000 {
31+
if nostr.IsEphemeralKind(evt.Kind) {
3232
// do not store ephemeral events
3333
for _, oee := range rl.OnEphemeralEvent {
3434
oee(ctx, evt)

examples/basic-lmdb/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func main() {
1313
relay := khatru.NewRelay()
1414

1515
db := lmdb.LMDBBackend{Path: "/tmp/khatru-lmdb-tmp"}
16-
os.MkdirAll(db.Path, 0755)
16+
os.MkdirAll(db.Path, 0o755)
1717
if err := db.Init(); err != nil {
1818
panic(err)
1919
}

examples/exclusive/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func main() {
1616
relay := khatru.NewRelay()
1717

1818
db := lmdb.LMDBBackend{Path: "/tmp/exclusive"}
19-
os.MkdirAll(db.Path, 0755)
19+
os.MkdirAll(db.Path, 0o755)
2020
if err := db.Init(); err != nil {
2121
panic(err)
2222
}

policies/nip04.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package policies
22

33
import (
44
"context"
5-
65
"slices"
76

87
"github.com/fiatjaf/khatru"

0 commit comments

Comments
 (0)