sdk: FetchSpecificEvent takes an option SaveToLocalStore that defaults to false.

This commit is contained in:
fiatjaf
2025-05-06 11:57:15 -03:00
parent 0d99789a54
commit a58015b3e9

View File

@@ -18,8 +18,10 @@ type FetchSpecificEventParameters struct {
WithRelays bool WithRelays bool
// SkipLocalStore indicates whether to skip checking the local store for the event // SkipLocalStore indicates whether to skip checking the local store for the event
// and storing the result in the local store.
SkipLocalStore bool SkipLocalStore bool
// SaveToLocalStore indicates the result should be saved to local store
SaveToLocalStore bool
} }
// FetchSpecificEventFromInput tries to get a specific event from a NIP-19 code or event ID. // FetchSpecificEventFromInput tries to get a specific event from a NIP-19 code or event ID.
@@ -165,7 +167,7 @@ attempts:
} }
// save stuff in cache and in internal store // save stuff in cache and in internal store
if !params.SkipLocalStore { if params.SaveToLocalStore {
sys.Publisher.Publish(ctx, *result) sys.Publisher.Publish(ctx, *result)
} }