use new nostr-sdk with hints (full outbox) support for improved event fetching that hopefully works.

This commit is contained in:
fiatjaf
2024-07-27 22:58:10 -03:00
parent 0113da6120
commit 56b3919d4e
10 changed files with 177 additions and 182 deletions

View File

@@ -231,7 +231,7 @@ func quotesAsBlockPrefixedText(ctx context.Context, lines []string) []string {
submatch := nostrNoteNeventMatcher.FindStringSubmatch(matchText)
nip19 := submatch[0][6:]
event, _, err := getEvent(ctx, nip19, nil)
event, _, err := getEvent(ctx, nip19)
if err != nil {
// error case concat this to previous block
blocks[b] += matchText
@@ -884,3 +884,14 @@ func fixed266ToFloat(i fixed.Int26_6) float32 {
func floatToFixed266(f float32) fixed.Int26_6 {
return fixed.Int26_6(int(float64(f) * 64))
}
// clamp ensures val is in the inclusive range [low,high].
func clamp(val, low, high int) int {
if val < low {
return low
}
if val > high {
return high
}
return val
}