mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-03 02:35:52 +03:00
chat-hook: upgrade from old state and perform invitatory creation and subscription
This commit is contained in:
parent
1b3c14eeb1
commit
8367dfc77b
@ -15,15 +15,24 @@
|
||||
[%peer wire dock path]
|
||||
==
|
||||
::
|
||||
+$ state
|
||||
$% [%0 state-zero]
|
||||
+$ state-both
|
||||
$% state-zero
|
||||
state-one
|
||||
==
|
||||
::
|
||||
+$ state-zero
|
||||
$: synced=(map path ship)
|
||||
$: %0
|
||||
synced=(map path ship)
|
||||
boned=(map wire (list bone))
|
||||
==
|
||||
::
|
||||
+$ state-one
|
||||
$: %1
|
||||
synced=(map path ship)
|
||||
boned=(map wire (list bone))
|
||||
invite-created=_|
|
||||
==
|
||||
::
|
||||
+$ poke
|
||||
$% [%chat-action chat-action]
|
||||
[%permission-action permission-action]
|
||||
@ -33,17 +42,32 @@
|
||||
::
|
||||
--
|
||||
::
|
||||
|_ [bol=bowl:gall state]
|
||||
|_ [bol=bowl:gall state-one]
|
||||
::
|
||||
++ this .
|
||||
::
|
||||
++ prep
|
||||
|= old=(unit state)
|
||||
|= old=(unit state-both)
|
||||
^- (quip move _this)
|
||||
:_ ?~(old this this(+<+ u.old))
|
||||
:~ (invite-poke [%create /chat])
|
||||
[ost.bol %peer /invites [our.bol %invite-store] /invitatory/chat]
|
||||
[ost.bol %peer /permissions [our.bol %permission-store] /updates]
|
||||
?~ old
|
||||
:_ this(invite-created %.y)
|
||||
:~ (invite-poke [%create /chat])
|
||||
[ost.bol %peer /invites [our.bol %invite-store] /invitatory/chat]
|
||||
[ost.bol %peer /permissions [our.bol %permission-store] /updates]
|
||||
==
|
||||
?- -.u.old
|
||||
%1 [~ this(+<+ u.old)]
|
||||
::
|
||||
%0
|
||||
=/ sta *state-one
|
||||
=: boned.sta boned.u.old
|
||||
synced.sta synced.u.old
|
||||
invite-created %.y
|
||||
==
|
||||
:_ this(+<+ sta)
|
||||
:~ (invite-poke [%create /chat])
|
||||
[ost.bol %peer /invites [our.bol %invite-store] /invitatory/chat]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ poke-json
|
||||
|
Loading…
Reference in New Issue
Block a user