mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
use new nostr-sdk with hints (full outbox) support for improved event fetching that hopefully works.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user