mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-10 18:21:34 +03:00
chat: Move eval logic out of /lib/chat-json
This allows us to always include the bowl when evaluating a code letter.
This commit is contained in:
parent
0da8e1efb3
commit
e567de9c18
@ -1,6 +1,6 @@
|
||||
:: chat-store: data store that holds linear sequences of chat messages
|
||||
::
|
||||
/+ *chat-json
|
||||
/+ *chat-json, *chat-eval
|
||||
|%
|
||||
+$ move [bone card]
|
||||
::
|
||||
@ -193,6 +193,10 @@
|
||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
||||
?~ mailbox
|
||||
[~ this]
|
||||
=* letter letter.envelope.act
|
||||
=? letter &(?=(%code -.letter) ?=(~ output.letter))
|
||||
=/ =hoon (ream expression.letter)
|
||||
letter(output (eval bol hoon))
|
||||
=: length.config.u.mailbox +(length.config.u.mailbox)
|
||||
number.envelope.act length.config.u.mailbox
|
||||
envelopes.u.mailbox (snoc envelopes.u.mailbox envelope.act)
|
||||
|
@ -37,10 +37,8 @@
|
||||
?~ exp
|
||||
[~ '' ~]
|
||||
:+ ~ u.exp
|
||||
=/ res ((ot output+(ar dank) ~) a)
|
||||
?^ res
|
||||
u.res
|
||||
(eval:chat-eval *bowl:gall (ream u.exp))
|
||||
::NOTE when sending, if output is an empty list, chat-store will evaluate
|
||||
(fall ((ot output+(ar dank) ~) a) ~)
|
||||
::
|
||||
++ lett
|
||||
|= =letter
|
||||
|
Loading…
Reference in New Issue
Block a user