mirror of
https://github.com/aljazceru/haven.git
synced 2025-12-18 14:24:18 +01:00
blast after save
This commit is contained in:
@@ -62,7 +62,7 @@ func loadConfig() Config {
|
||||
DBEngine: getEnv("DB_ENGINE"),
|
||||
RelayURL: getEnv("RELAY_URL"),
|
||||
RelaySoftware: "https://github.com/bitvora/haven",
|
||||
RelayVersion: "v0.4.2",
|
||||
RelayVersion: "v0.4.4",
|
||||
PrivateRelayName: getEnv("PRIVATE_RELAY_NAME"),
|
||||
PrivateRelayNpub: getEnv("PRIVATE_RELAY_NPUB"),
|
||||
PrivateRelayDescription: getEnv("PRIVATE_RELAY_DESCRIPTION"),
|
||||
|
||||
9
main.go
9
main.go
@@ -238,10 +238,6 @@ func makeNewRelay(relayType string, w http.ResponseWriter, r *http.Request) *kha
|
||||
return inboxRelay
|
||||
|
||||
default: // default to outbox
|
||||
outboxRelay.StoreEvent = append(outboxRelay.StoreEvent, outboxDB.SaveEvent, func(ctx context.Context, event *nostr.Event) error {
|
||||
go blast(event)
|
||||
return nil
|
||||
})
|
||||
outboxRelay.QueryEvents = append(outboxRelay.QueryEvents, outboxDB.QueryEvents)
|
||||
outboxRelay.DeleteEvent = append(outboxRelay.DeleteEvent, outboxDB.DeleteEvent)
|
||||
|
||||
@@ -252,6 +248,11 @@ func makeNewRelay(relayType string, w http.ResponseWriter, r *http.Request) *kha
|
||||
return true, "only notes signed by the owner of this relay are allowed"
|
||||
})
|
||||
|
||||
outboxRelay.StoreEvent = append(outboxRelay.StoreEvent, outboxDB.SaveEvent, func(ctx context.Context, event *nostr.Event) error {
|
||||
go blast(event)
|
||||
return nil
|
||||
})
|
||||
|
||||
mux := outboxRelay.Router()
|
||||
|
||||
mux.HandleFunc(relayType, func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user