diff --git a/khatru/listener.go b/khatru/listener.go index 3730a7b..d3da7c3 100644 --- a/khatru/listener.go +++ b/khatru/listener.go @@ -139,7 +139,7 @@ listenersloop: for _, listener := range rl.listeners { if listener.filter.Matches(event) { if nil != rl.PreventBroadcast { - if rl.PreventBroadcast(listener.ws, event) { + if rl.PreventBroadcast(listener.ws, listener.filter, event) { continue listenersloop } } diff --git a/khatru/relay.go b/khatru/relay.go index 4ae3ec7..00a2a62 100644 --- a/khatru/relay.go +++ b/khatru/relay.go @@ -78,7 +78,7 @@ type Relay struct { OnConnect func(ctx context.Context) OnDisconnect func(ctx context.Context) OverwriteRelayInformation func(ctx context.Context, r *http.Request, info nip11.RelayInformationDocument) nip11.RelayInformationDocument - PreventBroadcast func(ws *WebSocket, event nostr.Event) bool + PreventBroadcast func(ws *WebSocket, filter nostr.Filter, event nostr.Event) bool // this can be ignored unless you know what you're doing ChallengePrefix string