summaryrefslogtreecommitdiff
path: root/desk/app
diff options
context:
space:
mode:
Diffstat (limited to 'desk/app')
-rw-r--r--desk/app/nostrill.hoon36
1 files changed, 27 insertions, 9 deletions
diff --git a/desk/app/nostrill.hoon b/desk/app/nostrill.hoon
index cbd1c2f..611830f 100644
--- a/desk/app/nostrill.hoon
+++ b/desk/app/nostrill.hoon
@@ -1,7 +1,7 @@
/- sur=nostrill, nsur=nostr
/+ lib=nostrill, nlib=nostr, sr=sortug,
shim, dbug, muta=nostrill-mutations, jsonlib=json-nostrill,
- trill=trill-post, comms=nostrill-comms, followlib=follows
+ trill=trill-post, comms=nostrill-comms, followlib=nostrill-follows
/= web /web/router
|%
+$ versioned-state $%(state-0:sur)
@@ -32,11 +32,11 @@
++ on-load
|~ old-state=vase
^- (quip card:agent:gall agent:gall)
- :: =/ old-state !<(versioned-state old-state)
- :: ?- -.old-state
- :: %0 `this(state old-state)
- :: ==
- `this(state (default-state:lib bowl))
+ =/ old-state !<(versioned-state old-state)
+ ?- -.old-state
+ %0 `this(state old-state)
+ ==
+ :: `this(state (default-state:lib bowl))
::
++ on-poke
|~ [=mark =vase]
@@ -239,6 +239,11 @@
=/ =fact:ui:sur [%post %add *post-wrapper:sur]
=/ card (update-ui:cards fact)
:_ this :~(card)
+ %kick
+ :_ this =/ subs ~(tap by sup.bowl)
+ %+ turn subs |= [* p=@p pat=path]
+ [%give %kick ~[pat] ~]
+
==
::
@@ -279,9 +284,22 @@
++ on-agent
|~ [wire=(pole knot) =sign:agent:gall]
^- (quip card:agent:gall agent:gall)
- ~& on-agent=wire
- ~& on-agent=sign
- `this
+ ~& on-agent=[wire -.sign]
+ :: if p.sign is not ~ here that means it's intentional
+ ?+ wire `this
+ [%refollow ~]
+ ?. ?=(%watch-ack -.sign) `this
+ ?~ p.sign `this
+ =^ cs state (handle-kick-nack:fols src.bowl) [cs this]
+ [%follow ~]
+ ?: ?=(%kick -.sign)
+ =^ cs state (handle-refollow:fols src.bowl)
+ [cs this]
+ ?. ?=(%fact -.sign) `this
+ =^ cs state (handle-agent-res:fols q.q.cage.sign)
+ [cs this]
+
+ ==
::
++ on-arvo
|~ [wire=(pole knot) =sign-arvo]