mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
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:
commit
6c938e188d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user