mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-11-21 16:17:13 +00:00
removed NOTICE responses from kind handling
This commit is contained in:
parent
9edd7f6337
commit
9bab1e3a0a
@ -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
|
||||
}
|
||||
|
@ -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)")
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user