khatru: PreventBroadcast() also gets passed the filter.
This commit is contained in:
@@ -139,7 +139,7 @@ listenersloop:
|
|||||||
for _, listener := range rl.listeners {
|
for _, listener := range rl.listeners {
|
||||||
if listener.filter.Matches(event) {
|
if listener.filter.Matches(event) {
|
||||||
if nil != rl.PreventBroadcast {
|
if nil != rl.PreventBroadcast {
|
||||||
if rl.PreventBroadcast(listener.ws, event) {
|
if rl.PreventBroadcast(listener.ws, listener.filter, event) {
|
||||||
continue listenersloop
|
continue listenersloop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ type Relay struct {
|
|||||||
OnConnect func(ctx context.Context)
|
OnConnect func(ctx context.Context)
|
||||||
OnDisconnect func(ctx context.Context)
|
OnDisconnect func(ctx context.Context)
|
||||||
OverwriteRelayInformation func(ctx context.Context, r *http.Request, info nip11.RelayInformationDocument) nip11.RelayInformationDocument
|
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
|
// this can be ignored unless you know what you're doing
|
||||||
ChallengePrefix string
|
ChallengePrefix string
|
||||||
|
|||||||
Reference in New Issue
Block a user