diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/app/nostrill.hoon | 12 | ||||
| -rw-r--r-- | app/lib/json/nostr.hoon | 5 | ||||
| -rw-r--r-- | app/lib/nostr/client.hoon | 12 | ||||
| -rw-r--r-- | app/lib/websockets.hoon | 5 |
4 files changed, 31 insertions, 3 deletions
diff --git a/app/app/nostrill.hoon b/app/app/nostrill.hoon index 9d67dea..230f72f 100644 --- a/app/app/nostrill.hoon +++ b/app/app/nostrill.hoon @@ -234,6 +234,11 @@ :_ this :~ (connect:ws endpoint bowl) == + %wscancel + =/ wid 1 + :_ this + :~ (cancel-connect:ws wid) + == %wstest :: =/ url 'ws://localhost:8888' =/ url 'wss://nos.lol' @@ -313,6 +318,13 @@ $(pfs t.pfs) `this + [%prof @] + =/ pubkey=(unit @ux) (slaw:sr %ux +.noun) + ~& pubkey=pubkey + ?~ pubkey ~& "pubkey not valid hex. take out the 0x maybe" !! + =^ cs state (get-profile:nclient u.pubkey) + [cs this] + %wtf =/ lol=(unit @) ~ =/ l ~| "wtf" (need lol) 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) |
