From a465c73178dc621578d10312f263355f0f2d5309 Mon Sep 17 00:00:00 2001 From: polwex Date: Tue, 18 Nov 2025 09:43:16 +0700 Subject: fixes to profile handling and rendering --- app/lib/json/nostr.hoon | 5 ++++- app/lib/nostr/client.hoon | 12 ++++++++++-- app/lib/websockets.hoon | 5 +++++ 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'app/lib') diff --git a/app/lib/json/nostr.hoon b/app/lib/json/nostr.hoon index 3c42f0b..ca4ed43 100644 --- a/app/lib/json/nostr.hoon +++ b/app/lib/json/nostr.hoon @@ -276,10 +276,13 @@ ?~ crd $(fields t.fields) $(fields t.fields, um um(name u.crd)) %'about' =/ crd (so jn) - ?~ crd $(fields t.fields) $(fields t.fields, um um(picture u.crd)) + ?~ crd $(fields t.fields) $(fields t.fields, um um(about u.crd)) %'picture' =/ crd (so jn) ?~ crd $(fields t.fields) $(fields t.fields, um um(picture u.crd)) + %'image' + =/ crd (so jn) + ?~ crd $(fields t.fields) $(fields t.fields, um um(picture u.crd)) == -- -- diff --git a/app/lib/nostr/client.hoon b/app/lib/nostr/client.hoon index 741c51e..9c732bb 100644 --- a/app/lib/nostr/client.hoon +++ b/app/lib/nostr/client.hoon @@ -69,6 +69,13 @@ =/ =filter:nsur [~ `pubkeys `kinds ~ ~ ~ ~] (send-req ~[filter] .y ~) +++ get-profile |= pubkey=@ux + =/ kinds (silt ~[0]) + :: =/ since (to-unix-secs:jikan:sr last-week) + =/ pubkeys (silt ~[pubkey]) + =/ =filter:nsur [~ `pubkeys `kinds ~ ~ ~ ~] + (send-req ~[filter] .n ~) + ++ get-profiles ^- (quip card _state) =/ npoasts (tap:norm:sur nostr-feed.state) @@ -80,11 +87,12 @@ =. missing-profs ?: have missing-profs (~(put in missing-profs) pubkey.poast) $(npoasts t.npoasts) =/ kinds (silt ~[0]) - ?. (gth ~(wyt in pubkeys) 300) + =/ chunk-size 300 + ?. (gth ~(wyt in pubkeys) chunk-size) =/ =filter:nsur [~ `pubkeys `kinds ~ ~ ~ ~] (send-req ~[filter] .n ~) :: - =/ chunks=(list (list @ux)) (chunk-by-size:seq ~(tap in pubkeys) 300) + =/ chunks=(list (list @ux)) (chunk-by-size:seq ~(tap in pubkeys) chunk-size) ?~ chunks ~& >>> "error chunking pubkeys" `state =/ queue=(list filter:nsur) %+ turn t.chunks |= l=(list @ux) ^- filter:nsur diff --git a/app/lib/websockets.hoon b/app/lib/websockets.hoon index ae48775..a87f2a1 100644 --- a/app/lib/websockets.hoon +++ b/app/lib/websockets.hoon @@ -4,6 +4,11 @@ =/ =task:iris [%websocket-connect dap.bowl endpoint] [%pass /ws-connect %arvo %i task] + ++ cancel-connect |= wid=@ud + ^- card:agent:gall + =/ =task:iris [%cancel-websocket wid] + [%pass /ws-connect %arvo %i task] + ++ disconnect |= wid=@ud ^- card:agent:gall =/ =path /websocket-client/(scot %ud wid) -- cgit v1.2.3