Merge pull request #1 from urbit/dm

direct message prototype
This commit is contained in:
Liam Fitzgerald 2024-04-18 11:16:50 -04:00 committed by GitHub
commit 04937a89ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,64 @@
/@ dm-diff
/@ message
=>
|%
++ card card:neo
--
^- firm:neo
|%
++ state %sig
++ poke (sy %dm-diff %rely ~)
++ kids
%- ~(gas by *kids:neo)
:~ :- ~[|/%da]
[%message %sig]
==
++ deps
%- ~(gas by *deps:neo)
:~
::
:- %link
::
:+ req=| [%sig %dm-diff]
:+ ~ %y
%- ~(gas by *kids:neo)
:~ :- [|/%da]~
[%message %sig]
==
==
++ form
^- form:neo
|_ [=bowl:neo =ever:neo state-vase=vase *]
++ poke
|= [=stud:neo vax=vase]
^- (quip card:neo vase)
?: =(%rely stud)
=+ !<([=term =stem:neo] vax)
?> ?=(%y -.q.stem)
=/ =pail:neo pail:(snag 0 ~(val by kids.q.stem))
=+ !<(=message q.pail)
:: TODO handle
?< =(our.bowl from.message)
:_ !>(~)
:_ ~
:*
(welp here.bowl ~[da/now.bowl])
%make
[%message `q.pail ~]
==
?> =(%dm-diff stud)
=/ poke !<(dm-diff vax)
?> =(our ship.src):bowl
?> =(%msg -.poke)
:_ !>(~)
:~
:*
(welp were.bowl ~[da/now.bowl])
%make
[%message `!>(message.poke) ~]
==
==
++ init
|= old=(unit vase) `!>(~)
--
--

View File

@ -0,0 +1,2 @@
/@ message
,[%msg =message]