diff options
| author | polwex <polwex@sortug.com> | 2025-10-06 07:58:25 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-06 07:58:25 +0700 |
| commit | 410cc8e8949c6ab0677daebbad10cea5f1b9686c (patch) | |
| tree | 2946ca36a81d5642fb8cd53a2268ecca0e89b59e /app/lib/mutations/nostr.hoon | |
| parent | c4b392a179048f936c062f5ffccc2bc25627e500 (diff) | |
added websockets server logic to nostrill
Diffstat (limited to 'app/lib/mutations/nostr.hoon')
| -rw-r--r-- | app/lib/mutations/nostr.hoon | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/lib/mutations/nostr.hoon b/app/lib/mutations/nostr.hoon index 2c6acd5..96ea6c6 100644 --- a/app/lib/mutations/nostr.hoon +++ b/app/lib/mutations/nostr.hoon @@ -3,6 +3,9 @@ /+ appjs=json-nostrill, lib=nostrill, + nlib=nostr, + nreq=nostr-req, + server, njs=json-nostr, postlib=trill-post, shim, @@ -11,6 +14,21 @@ |_ [=state:sur =bowl:gall] +$ card card:agent:gall :: events +++ handle-client-event |= [wid=@ =event:nsur] ^- (quip card _state) + ~& handling-client-event=event + =. nostr-feed.state (put:norm:sur nostr-feed.state created-at.event event) + =/ profile (~(get by profiles.state [%nostr author.event])) + :: TODO save if we're following? + :: =/ pw (event-to-post:nlib event profile) + =/ response (ok-client-event event .n 'we\'re full') + =/ cs (ws-response:nreq response) + [cs state] + :: =/ l events.state + :: =| cards=(list card:agent:gall) + :: |- ?~ l [cards state] + :: =/ n (event-parsing i.l) + :: $(cards -.n, state +.n, l t.l) + ++ process-events ^- (quip card _state) :: =/ l events.state :: =| cards=(list card:agent:gall) |
