mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
initial prep subscribe, mark and app stubs
This commit is contained in:
parent
a95ca0dbf2
commit
0c6baef0d9
@ -29,7 +29,7 @@
|
||||
:: stores the collection built by above by :cols so that we can compare old
|
||||
:: and new versions whenever the rendered data changes
|
||||
::
|
||||
~% %collections ..^is ~
|
||||
~% %landscape ..^is ~
|
||||
|_ [bol=bowl:gall sta=state]
|
||||
::
|
||||
:: +this: app core subject
|
||||
@ -44,19 +44,29 @@
|
||||
:: then update state to store the new collection data
|
||||
::
|
||||
++ prep
|
||||
~/ %coll-prep
|
||||
~/ %land-prep
|
||||
|= old=(unit state)
|
||||
^- (quip move _this)
|
||||
?~ old
|
||||
:_ this
|
||||
;: welp
|
||||
=< ta-done
|
||||
(~(ta-hall-create-circle ta ~ bol) /c 'collections')
|
||||
::
|
||||
:~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
|
||||
==
|
||||
==
|
||||
?- -.u.old
|
||||
%0
|
||||
=/ mow=(list move)
|
||||
=< ta-done
|
||||
(~(ta-update ta ~ bol) col.u.old cols)
|
||||
[mow this(sta [%0 cols])]
|
||||
:- mow
|
||||
%= this
|
||||
sta [%0 cols str.u.old]
|
||||
==
|
||||
==
|
||||
::
|
||||
:: +mack:
|
||||
@ -64,7 +74,6 @@
|
||||
:: recieve acknowledgement for permissions changes, print error if it failed
|
||||
::
|
||||
++ mack
|
||||
~/ %coll-mack
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
@ -74,7 +83,6 @@
|
||||
:: +coup: recieve acknowledgement for poke, print error if it failed
|
||||
::
|
||||
++ coup
|
||||
~/ %coll-coup
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
@ -116,4 +124,188 @@
|
||||
=< ta-done
|
||||
(~(ta-write ta ~ bol) /web/landscape/onboard/json [%json !>(jon)])
|
||||
[~ this]
|
||||
::
|
||||
::
|
||||
::
|
||||
::
|
||||
::
|
||||
++ peer
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
:: +reap: recieve acknowledgement for peer, retry on failure
|
||||
::
|
||||
++ reap
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
[~ this]
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circles
|
||||
:_ this
|
||||
[ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]~
|
||||
::
|
||||
%inbox
|
||||
:_ this
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]~
|
||||
::
|
||||
%invites
|
||||
:_ this
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]~
|
||||
::
|
||||
%our
|
||||
[~ this]
|
||||
::
|
||||
%sub
|
||||
[~ this]
|
||||
==
|
||||
|
||||
:: :~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
|
||||
:: [ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
|
||||
:: [ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
|
||||
:: ==
|
||||
|
||||
|
||||
::
|
||||
:: +quit:
|
||||
::
|
||||
++ quit
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
[~ this]
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circles
|
||||
:_ this
|
||||
[ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]~
|
||||
::
|
||||
%inbox
|
||||
:_ this
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]~
|
||||
::
|
||||
%invites
|
||||
:_ this
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]~
|
||||
::
|
||||
%our
|
||||
[~ this]
|
||||
::
|
||||
%sub
|
||||
[~ this]
|
||||
==
|
||||
::
|
||||
:: +diff-hall-prize:
|
||||
::
|
||||
::
|
||||
::
|
||||
++ diff-hall-prize
|
||||
|= [wir=wire piz=prize:hall]
|
||||
^- (quip move _this)
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
:: %circles: subscribe to the configuration of each of our circles
|
||||
::
|
||||
%circles
|
||||
?> ?=(%circles -.piz)
|
||||
=/ circs=(set name:hall) (~(dif in cis.piz) (sy ~[%inbox %i %public]))
|
||||
::
|
||||
:_ this
|
||||
^- (list move)
|
||||
%+ turn ~(tap in circs)
|
||||
|= circ=name:hall
|
||||
^- move
|
||||
[ost.bol %peer /our/[circ] [our.bol %hall] /circle/[circ]/config]
|
||||
::
|
||||
:: %inbox:
|
||||
::
|
||||
%inbox
|
||||
[~ this]
|
||||
::
|
||||
:: %invites
|
||||
::
|
||||
%invites
|
||||
[~ this]
|
||||
::
|
||||
%our
|
||||
[~ this]
|
||||
::
|
||||
%sub
|
||||
[~ this]
|
||||
==
|
||||
|
||||
:: :~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
|
||||
:: [ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
|
||||
:: [ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
|
||||
:: ==
|
||||
|
||||
::
|
||||
:: +diff-hall-rumor
|
||||
::
|
||||
::
|
||||
::
|
||||
++ diff-hall-rumor
|
||||
|= [wir=wire rum=rumor:hall]
|
||||
^- (quip move _this)
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circles
|
||||
[~ this]
|
||||
::
|
||||
%inbox
|
||||
[~ this]
|
||||
::
|
||||
%invites
|
||||
[~ this]
|
||||
::
|
||||
%our
|
||||
[~ this]
|
||||
::
|
||||
%sub
|
||||
[~ this]
|
||||
==
|
||||
--
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -8,35 +8,81 @@
|
||||
::
|
||||
~% %collections-lib ..is ~
|
||||
|%
|
||||
+= move [bone card]
|
||||
+= card
|
||||
+$ move [bone card]
|
||||
::
|
||||
+$ card
|
||||
$% [%info wire toro:clay]
|
||||
[%poke wire dock poke]
|
||||
[%perm wire desk path rite:clay]
|
||||
[%peer wire dock path]
|
||||
[%pull wire dock ~]
|
||||
==
|
||||
+= poke
|
||||
::
|
||||
+$ poke
|
||||
$% [%hall-action action:hall]
|
||||
[%collections-action action]
|
||||
[%json json]
|
||||
==
|
||||
+= state
|
||||
$% [%0 col=collection]
|
||||
::
|
||||
+$ state
|
||||
$% [%0 col=collection str=streams]
|
||||
==
|
||||
::
|
||||
+$ streams
|
||||
$: :: inbox config and the last 30 messages in it
|
||||
::
|
||||
inbox=[con=config env=(list envelope:hall)]
|
||||
:: names and configs of all circles we own
|
||||
::
|
||||
our-circles=(map name:hall config:hall)
|
||||
:: names and configs of all circles we're subscribed to
|
||||
::
|
||||
sub-circles=(map circle:hall config:hall)
|
||||
:: all the DM invites we've received
|
||||
::
|
||||
invites=(list envelope:hall)
|
||||
==
|
||||
::
|
||||
+= collection [meta=config data=(map nom=knot =item)]
|
||||
+= item
|
||||
+$ prize
|
||||
$: :: inbox config and the last 30 messages in it
|
||||
::
|
||||
inbox=[con=config env=(list envelope:hall)]
|
||||
:: names and configs of all circles we own
|
||||
::
|
||||
our-circles=(map name:hall config:hall)
|
||||
:: names and configs of all circles we're subscribed to
|
||||
::
|
||||
sub-circles=(map circle:hall config:hall)
|
||||
:: all the DM invites we've received
|
||||
::
|
||||
invites=(list envelope:hall)
|
||||
==
|
||||
::
|
||||
+$ rumor
|
||||
$% :: if config is given, either add new circle or update existing one
|
||||
:: if config is nil then delete circle
|
||||
::
|
||||
[%circle-change circle:hall config:hall]
|
||||
:: recieved a new inbox message or DM invite
|
||||
::
|
||||
[%new-msg ?(%inbox %invites) envelope:hall]
|
||||
==
|
||||
::
|
||||
+$ collection [meta=config data=(map nom=knot =item)]
|
||||
::
|
||||
+$ item
|
||||
$~ [%error ~]
|
||||
$% [%collection col=collection]
|
||||
[%raw raw=raw-item]
|
||||
[%both col=collection raw=raw-item]
|
||||
[%error ~]
|
||||
==
|
||||
+= raw-item
|
||||
::
|
||||
+$ raw-item
|
||||
$% [%udon meta=(map knot cord) data=@t]
|
||||
==
|
||||
::
|
||||
+= config
|
||||
+$ config
|
||||
$: full-path=beam
|
||||
name=@t
|
||||
description=@t
|
||||
@ -53,12 +99,13 @@
|
||||
::
|
||||
==
|
||||
::
|
||||
+= action
|
||||
+$ action
|
||||
$: who=ship
|
||||
dek=desk
|
||||
acts=(list sub-action)
|
||||
==
|
||||
+= sub-action
|
||||
::
|
||||
+$ sub-action
|
||||
$% [%write pax=path for=form]
|
||||
[%delete pax=path]
|
||||
[%perms pax=path r=rule:clay w=rule:clay]
|
||||
@ -68,7 +115,7 @@
|
||||
[%comment pax=path content=@t]
|
||||
==
|
||||
::
|
||||
+= form
|
||||
+$ form
|
||||
$% [%udon @t]
|
||||
[%collections-config config]
|
||||
==
|
||||
|
17
mar/collections/prize.hoon
Normal file
17
mar/collections/prize.hoon
Normal file
@ -0,0 +1,17 @@
|
||||
::
|
||||
::
|
||||
/? 309
|
||||
::
|
||||
/+ collections, hall-json
|
||||
::
|
||||
|_ piz=prize:collections
|
||||
++ grow
|
||||
|%
|
||||
++ json ~
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun prize:collections
|
||||
--
|
||||
--
|
17
mar/collections/rumor.hoon
Normal file
17
mar/collections/rumor.hoon
Normal file
@ -0,0 +1,17 @@
|
||||
::
|
||||
::
|
||||
/? 309
|
||||
::
|
||||
/+ collections, hall-json
|
||||
::
|
||||
|_ rum=rumor:collections
|
||||
++ grow
|
||||
|%
|
||||
++ json ~
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun rumor:collections
|
||||
--
|
||||
--
|
Loading…
Reference in New Issue
Block a user