Merge branch 'm/chat-store-eval' (#2010)

* m/chat-store-eval:
  chat-store: only evaluate our own %code

Signed-off-by: Jared Tobin <jared@tlon.io>
This commit is contained in:
Jared Tobin 2019-12-05 20:59:13 +08:00
commit 6c938e188d
No known key found for this signature in database
GPG Key ID: 0E4647D58F8A69E4

View File

@ -181,8 +181,8 @@
?> ?=(%message -.act)
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
?~ mailbox
[~ state]
=. letter.envelope.act (evaluate-letter letter.envelope.act)
[~ this]
=. letter.envelope.act (evaluate-letter [author letter]:envelope.act)
=. u.mailbox (append-envelope u.mailbox envelope.act)
:- (send-diff path.act act)
state(inbox (~(put by inbox) path.act u.mailbox))
@ -202,10 +202,10 @@
:* %messages
path.act
(sub length.config.u.mailbox (lent evaluated-envelopes))
length.config.u.mailbox
length.config.u.mailbox
evaluated-envelopes
==
=. letter.i.envelopes.act (evaluate-letter letter.i.envelopes.act)
=. letter.i.envelopes.act (evaluate-letter [author letter]:i.envelopes.act)
=. evaluated-envelopes (snoc evaluated-envelopes i.envelopes.act)
=. u.mailbox (append-envelope u.mailbox i.envelopes.act)
$(envelopes.act t.envelopes.act)
@ -222,9 +222,13 @@
state(inbox (~(put by inbox) path.act u.mailbox))
::
++ evaluate-letter
|= =letter
|= [author=ship =letter]
^- ^letter
=? letter &(?=(%code -.letter) ?=(~ output.letter))
=? letter
?& ?=(%code -.letter)
?=(~ output.letter)
(team:title our.bol author)
==
=/ =hoon (ream expression.letter)
letter(output (eval bol hoon))
letter