2024-07-25 14:05:33 +00:00
|
|
|
package kinds
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-07-31 18:12:33 +00:00
|
|
|
"grain/server/handlers/response"
|
|
|
|
relay "grain/server/types"
|
2024-07-25 14:05:33 +00:00
|
|
|
|
|
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
|
|
"golang.org/x/net/websocket"
|
|
|
|
)
|
|
|
|
|
|
|
|
func HandleUnknownKind(ctx context.Context, evt relay.Event, collection *mongo.Collection, ws *websocket.Conn) error {
|
|
|
|
// Respond with an OK message indicating the event is not accepted
|
2024-07-27 14:06:34 +00:00
|
|
|
response.SendOK(ws, evt.ID, false, "invalid: kind is outside the ranges defined in NIP01")
|
2024-07-25 14:05:33 +00:00
|
|
|
|
|
|
|
// Return nil as there's no error in the process, just that the event is not accepted
|
|
|
|
return nil
|
|
|
|
}
|