mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
commands to ban (and unban) events using the relay management api.
This commit is contained in:
@@ -72,6 +72,14 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if banned, reason := internal.isBanned(data.event.ID); banned {
|
||||
w.Header().Set("Cache-Control", "max-age=60")
|
||||
log.Warn().Err(err).Str("code", code).Str("reason", reason).Msg("event banned")
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
errorTemplate(ErrorPageParams{Errors: "event banned"}).Render(ctx, w)
|
||||
return
|
||||
}
|
||||
|
||||
// if we originally got a note code or an nevent with no hints
|
||||
// augment the URL to point to an nevent with hints -- redirect
|
||||
if p, ok := decoded.(nostr.EventPointer); (ok && p.Author == "" && len(p.Relays) == 0) || prefix == "note" {
|
||||
|
||||
Reference in New Issue
Block a user