mirror of
https://github.com/aljazceru/haven.git
synced 2025-12-18 22:24:22 +01:00
blast after save
This commit is contained in:
@@ -62,7 +62,7 @@ func loadConfig() Config {
|
|||||||
DBEngine: getEnv("DB_ENGINE"),
|
DBEngine: getEnv("DB_ENGINE"),
|
||||||
RelayURL: getEnv("RELAY_URL"),
|
RelayURL: getEnv("RELAY_URL"),
|
||||||
RelaySoftware: "https://github.com/bitvora/haven",
|
RelaySoftware: "https://github.com/bitvora/haven",
|
||||||
RelayVersion: "v0.4.2",
|
RelayVersion: "v0.4.4",
|
||||||
PrivateRelayName: getEnv("PRIVATE_RELAY_NAME"),
|
PrivateRelayName: getEnv("PRIVATE_RELAY_NAME"),
|
||||||
PrivateRelayNpub: getEnv("PRIVATE_RELAY_NPUB"),
|
PrivateRelayNpub: getEnv("PRIVATE_RELAY_NPUB"),
|
||||||
PrivateRelayDescription: getEnv("PRIVATE_RELAY_DESCRIPTION"),
|
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
|
return inboxRelay
|
||||||
|
|
||||||
default: // default to outbox
|
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.QueryEvents = append(outboxRelay.QueryEvents, outboxDB.QueryEvents)
|
||||||
outboxRelay.DeleteEvent = append(outboxRelay.DeleteEvent, outboxDB.DeleteEvent)
|
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"
|
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 := outboxRelay.Router()
|
||||||
|
|
||||||
mux.HandleFunc(relayType, func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc(relayType, func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user