diff options
Diffstat (limited to 'desk/app/nostrill.hoon')
-rw-r--r-- | desk/app/nostrill.hoon | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/desk/app/nostrill.hoon b/desk/app/nostrill.hoon index 37aaf06..721a590 100644 --- a/desk/app/nostrill.hoon +++ b/desk/app/nostrill.hoon @@ -1,5 +1,5 @@ -/- sur=nostrill, nsur=nostr -/+ lib=nostrill, nlib=nostr, sr=sortug, +/- sur=nostrill, nsur=nostr, tf=trill-feed +/+ lib=nostrill, nlib=nostr, sr=sortug, scri, shim, dbug, muta=nostrill-mutations, jsonlib=json-nostrill, trill=trill-post, comms=nostrill-comms, followlib=nostrill-follows /= web /web/router @@ -16,6 +16,7 @@ cards ~(. cards:lib bowl) mutat ~(. muta [state bowl]) shimm ~(. shim [state bowl]) + scry ~(. scri [state bowl]) coms ~(. comms [state bowl]) fols ~(. followlib [state bowl]) ++ on-init @@ -95,7 +96,38 @@ ++ handle-post |= poke=post-poke:ui:sur ?- -.poke %add - =/ sp (build-sp:trill our.bowl our.bowl content.poke) + =/ sp (build-sp:trill our.bowl our.bowl content.poke ~ ~) + =/ p (build-post:trill now.bowl pub.i.keys sp) + =. state (add-to-feed:mutat p) + =/ profile (~(get by profiles) [%urbit our.bowl]) + =/ pw [p (some pub.i.keys) ~ ~ profile] + =/ =fact:ui:sur [%post %add pw] + =/ card (update-ui:cards fact) + :_ this :~(card) + %quote + =/ sp (build-sp:trill our.bowl our.bowl content.poke ~ ~) + =/ quote [%ref %trill host.poke /(crip (scow:sr %ud id.poke))] + =. contents.sp (snoc contents.sp quote) + =/ p (build-post:trill now.bowl pub.i.keys sp) + =. state (add-to-feed:mutat p) + =/ profile (~(get by profiles) [%urbit our.bowl]) + =/ pw [p (some pub.i.keys) ~ ~ profile] + =/ =fact:ui:sur [%post %add pw] + =/ card (update-ui:cards fact) + :_ this :~(card) + %reply + =/ sp (build-sp:trill host.poke our.bowl content.poke `id.poke `thread.poke) + =/ p (build-post:trill now.bowl pub.i.keys sp) + =. state (add-to-feed:mutat p) + =/ profile (~(get by profiles) [%urbit our.bowl]) + =/ pw [p (some pub.i.keys) ~ ~ profile] + =/ =fact:ui:sur [%post %add pw] + =/ card (update-ui:cards fact) + :_ this :~(card) + %rp + =/ quote [%ref %trill host.poke /(crip (scow:sr %ud id.poke))] + =/ sp (build-sp:trill host.poke our.bowl '' ~ ~) + =. contents.sp ~[quote] =/ p (build-post:trill now.bowl pub.i.keys sp) =. state (add-to-feed:mutat p) =/ profile (~(get by profiles) [%urbit our.bowl]) @@ -104,8 +136,8 @@ =/ card (update-ui:cards fact) :_ this :~(card) - %rt `this - %del `this + :: %rt `this + :: %del `this == ++ handle-begs |= poke=begs-poke:ui:sur ?- -.poke @@ -174,7 +206,9 @@ ~& priv=(scow:sr %ux +.key) $(ks t.ks) %feed - =/ lol debug-own-feed:mutat + :: =/ lol debug-own-feed:mutat + ~& pry=(pry:orm:tf feed) + ~& ram=(ram:orm:tf feed) `this %nstats ~& nostr-feed=~(wyt by nostr-feed) @@ -280,9 +314,11 @@ ^- (unit (unit cage)) ~& > on-peek=pole ?+ pole ~ - [%j %feed rest=*] ~ - [%j %post rest=*] ~ + [%x %j %feed host=@ start=@ end=@ count=@ newest=@ replies=@ *] + (sfeed:scry host.pole start.pole end.pole count.pole newest.pole replies.pole) + [%x %j %thread host=@ id=@ *] (thread:scry host.pole id.pole) == + :: ++ on-agent |~ [wire=(pole knot) =sign:agent:gall] |