khatru: store and broadcast kind:5 deletion events.

by insistence of @staab
This commit is contained in:
fiatjaf
2025-10-31 16:36:39 -03:00
parent 32bbff615a
commit b87bc0ede4
5 changed files with 79 additions and 37 deletions

View File

@@ -208,9 +208,13 @@ func (rl *Relay) HandleWebsocket(w http.ResponseWriter, r *http.Request) {
var writeErr error
var skipBroadcast bool
if env.Event.Kind == 5 {
// this always returns "blocked: " whenever it returns an error
writeErr = srl.handleDeleteRequest(ctx, env.Event)
if env.Event.Kind == nostr.KindDeletion {
// store the delete event first
skipBroadcast, writeErr = srl.handleNormal(ctx, env.Event)
if writeErr == nil {
// this always returns "blocked: " whenever it returns an error
writeErr = srl.handleDeleteRequest(ctx, env.Event)
}
} else if env.Event.Kind.IsEphemeral() {
// this will also always return a prefixed reason
writeErr = srl.handleEphemeral(ctx, env.Event)