removed NOTICE responses from kind handling

This commit is contained in:
Chris kerr 2024-07-27 15:19:48 -04:00
parent 9edd7f6337
commit 9bab1e3a0a
4 changed files with 0 additions and 5 deletions

View File

@ -22,7 +22,6 @@ func HandleKind0(ctx context.Context, evt relay.Event, collection *mongo.Collect
if err != mongo.ErrNoDocuments {
if existingEvent.CreatedAt >= evt.CreatedAt {
response.SendNotice(ws, evt.PubKey, "blocked: a newer kind 0 event already exists for this pubkey")
response.SendOK(ws, evt.ID, false, "blocked: a newer kind 0 event already exists for this pubkey")
return nil
}

View File

@ -9,8 +9,6 @@ import (
)
func HandleKind2(ctx context.Context, evt relay.Event, ws *websocket.Conn) error {
// Send a NOTICE message to inform the client about the deprecation
response.SendNotice(ws, evt.PubKey, "kind 2 is deprecated, event not accepted to the relay, please use kind 10002 as defined in NIP-65")
// Send an OK message to indicate the event was not accepted
response.SendOK(ws, evt.ID, false, "invalid: kind 2 is deprecated, use kind 10002 (NIP65)")

View File

@ -22,7 +22,6 @@ func HandleReplaceableKind(ctx context.Context, evt relay.Event, collection *mon
if err != mongo.ErrNoDocuments {
if existingEvent.CreatedAt > evt.CreatedAt || (existingEvent.CreatedAt == evt.CreatedAt && existingEvent.ID < evt.ID) {
response.SendNotice(ws, evt.PubKey, "blocked: relay already has a newer event of the same kind with this pubkey")
response.SendOK(ws, evt.ID, false, "blocked: relay already has a newer event of the same kind with this pubkey")
return nil
}

View File

@ -29,7 +29,6 @@ func HandleParameterizedReplaceableKind(ctx context.Context, evt relay.Event, co
if err != mongo.ErrNoDocuments {
if existingEvent.CreatedAt > evt.CreatedAt || (existingEvent.CreatedAt == evt.CreatedAt && existingEvent.ID < evt.ID) {
response.SendNotice(ws, evt.PubKey, "blocked: relay already has a newer event for this pubkey and d tag")
response.SendOK(ws, evt.ID, false, "blocked: relay already has a newer event for this pubkey and d tag")
return nil
}