chat-cli: update to work with new structures
:: +read-post: add envelope to state and show it to user
::
++ read-post
- |= [=target =index:post =post:post]
+ |= [=target =index:post =maybe-post:graph]
^- (quip card _session)
- :- (show-post:sh-out target post)
+ ?- -.maybe-post
+ %| [~ session]
+ %&
+ :- (show-post:sh-out target p.maybe-post)
%_ session
history [[target index] history.session]
count +(count.session)
==
+ ==
::
++ notice-remove
|= =target
::TODO move creation into lib?
%^ act %out-message
%graph-push-hook
- :- %graph-update-1
+ :- %graph-update-2
!> ^- update:graph
:- now.bowl
:+ %add-nodes audience
%- ~(put by *(map index:post node:graph))
:- ~[now.bowl]
:_ *internal-graph:graph
- ^- post:post
- [our-self ~[now.bowl] now.bowl [msg]~ ~ ~]
+ ^- maybe-post:graph
+ [%& `post:post`[our-self ~[now.bowl] now.bowl [msg]~ ~ ~]]
:: +eval: run hoon, send code and result as message
::
:: this double-virtualizes and clams to disable .^ for security reasons
=/ =uid:post (snag index history)
=/ =node:graph (got-node:libgraph uid)
=. audience resource.uid
+ ?- -.post.node
+ %| [~ state]
+ %&
:_ put-ses
^- (list card)
:~ (print:sh-out ['?' ' ' number])
- (effect:sh-out ~(render-activate mr resource.uid post.node))
+ (effect:sh-out ~(render-activate mr resource.uid p.post.node))
prompt:sh-out
==
+ ==
--
:: +chats: display list of joined chats
::
