mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-06-05 08:42:04 +00:00
fix report handler.
This commit is contained in:
parent
36b446c056
commit
045e7d2218
4
relay.go
4
relay.go
@ -10,7 +10,7 @@ func rejectEventsFromUsersNotInWhitelist(ctx context.Context, event *nostr.Event
|
|||||||
if isPublicKeyInWhitelist(event.PubKey) {
|
if isPublicKeyInWhitelist(event.PubKey) {
|
||||||
return false, ""
|
return false, ""
|
||||||
}
|
}
|
||||||
if event.Kind == 1985 {
|
if event.Kind == 1984 {
|
||||||
// we accept reports from anyone (will filter them for relevance in the next function)
|
// we accept reports from anyone (will filter them for relevance in the next function)
|
||||||
return false, ""
|
return false, ""
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ var supportedKinds = []uint16{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func validateAndFilterReports(ctx context.Context, event *nostr.Event) (reject bool, msg string) {
|
func validateAndFilterReports(ctx context.Context, event *nostr.Event) (reject bool, msg string) {
|
||||||
if event.Kind == 1985 {
|
if event.Kind == 1984 {
|
||||||
if e := event.Tags.GetFirst([]string{"e", ""}); e != nil {
|
if e := event.Tags.GetFirst([]string{"e", ""}); e != nil {
|
||||||
// event report: check if the target event is here
|
// event report: check if the target event is here
|
||||||
res, _ := sys.StoreRelay.QuerySync(ctx, nostr.Filter{IDs: []string{(*e)[1]}})
|
res, _ := sys.StoreRelay.QuerySync(ctx, nostr.Filter{IDs: []string{(*e)[1]}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user