blast after save

This commit is contained in:
Barry Deen
2024-10-16 17:34:42 -04:00
parent 789021f655
commit 40cbb9ba68
2 changed files with 6 additions and 5 deletions

View File

@@ -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"),

View File

@@ -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) {