mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
Put remotes and mirrors back into config. They no longer contain local story data.
Reader doesn't care much, aside from changes to lowdowns. It subscribes exclusively to the default mailbox.
This commit is contained in:
parent
17b1abc0ba
commit
108431b2c9
@ -12,7 +12,8 @@
|
||||
::TODO maybe keep track of received grams per partner, too?
|
||||
::
|
||||
::x This reader implementation makes use of the mailbox for all its
|
||||
::x subscriptions and messaging.
|
||||
::x subscriptions and messaging. All lowdowns received are exclusively about
|
||||
::x the mailbox, since that's the only thing the reader ever subscribes to.
|
||||
::
|
||||
/? 310 :: hoon version
|
||||
/- talk, sole :: structures
|
||||
@ -191,22 +192,20 @@
|
||||
==
|
||||
::
|
||||
++ ra-low-confs
|
||||
|= cofs/(map station (unit config))
|
||||
|= {coy/(unit config) cofs/(map station (unit config))}
|
||||
^+ +>
|
||||
::x if possible, update sources. if we do, and we gain new ones, update
|
||||
::x the prompt. (this is to remove the mailbox from the audience after
|
||||
::x creating or joining a new station.)
|
||||
=. +>
|
||||
=+ cof=(fall (~(get by cofs) [our.hid (main our.hid)]) ~)
|
||||
?~ cof +>.$
|
||||
=. +>.$ ::TODO =?
|
||||
?~ (~(dif in sources.u.cof) sources) +>.$
|
||||
?~ coy ~&(%mailbox-deleted !!)
|
||||
=. +> ::TODO =?
|
||||
?~ (~(dif in sources.u.coy) sources) +>.$
|
||||
=< sh-abet
|
||||
%- ~(sh-pact sh(sources sources.u.cof) cli (main our.hid))
|
||||
(~(dif in sources.u.cof) sources)
|
||||
=. sources sources.u.cof
|
||||
+>.$
|
||||
=. +>
|
||||
%- ~(sh-pact sh(sources sources.u.coy) cli (main our.hid))
|
||||
(~(dif in sources.u.coy) sources)
|
||||
=. sources sources.u.coy
|
||||
=. cofs (~(put by cofs) [our.hid (main our.hid)] coy)
|
||||
=. +>.$
|
||||
=< sh-abet
|
||||
%+ roll (~(tap by cofs))
|
||||
|= {{s/station c/(unit config)} core/_sh}
|
||||
@ -224,19 +223,18 @@
|
||||
+>.$
|
||||
::
|
||||
++ ra-low-precs
|
||||
|= pas/(map partner atlas)
|
||||
|= {tas/atlas pas/(map partner atlas)}
|
||||
^+ +>
|
||||
=+ ner=(~(uni by remotes) pas) ::TODO per-partner uni.
|
||||
?: =(remotes ner) +>.$
|
||||
=. remotes ner
|
||||
sh-abet:(~(sh-low-rempe sh cli (main our.hid)) remotes ner)
|
||||
=. +>.$ sh-abet:(~(sh-low-rempe sh cli (main our.hid)) remotes ner)
|
||||
+>.$(remotes ner)
|
||||
::
|
||||
++ ra-low-grams
|
||||
::x apply new grams
|
||||
::
|
||||
|= {man/knot num/@ud gams/(list telegram)}
|
||||
|= {num/@ud gams/(list telegram)}
|
||||
^+ +>
|
||||
?. =(man (main our.hid)) ~&([%unexpected-grams man] +>)
|
||||
=. +>.$ sh-abet:(~(sh-low-grams sh cli (main our.hid)) num gams)
|
||||
(ra-lesson gams)
|
||||
::
|
||||
@ -285,9 +283,9 @@
|
||||
%- ra-emit
|
||||
:* ost.hid
|
||||
%peer
|
||||
/
|
||||
/ ::x return/diff path
|
||||
(broker our.hid)
|
||||
/reader/(main our.hid)
|
||||
/reader/(main our.hid) ::x peer path
|
||||
==
|
||||
::
|
||||
++ ra-lesson :: learn multiple
|
||||
@ -1784,6 +1782,9 @@
|
||||
::
|
||||
++ diff-talk-lowdown
|
||||
::x incoming talk-lowdown. process it.
|
||||
::x we *could* use the wire to identify what story subscription our lowdown
|
||||
::x is coming from, but since we only ever subscribe to a single story, we
|
||||
::x don't bother.
|
||||
::
|
||||
|= {way/wire low/lowdown}
|
||||
ra-abet:(ra-low:ra low)
|
||||
|
@ -11,8 +11,6 @@
|
||||
::TODO maybe ensure every arm has a mini-description at :57 too?
|
||||
::TODO maybe prefix all printfs and other errors with %talk?
|
||||
::
|
||||
::TODO put remotes and mirrors back into stories.
|
||||
::
|
||||
::TODO do permission checks for the whole team instead of just a ship, maybe?
|
||||
::TODO sending remotes and mirrors alongside locals and shape no longer makes
|
||||
:: any sense, does it?
|
||||
@ -33,8 +31,6 @@
|
||||
=> |% :: data structures
|
||||
++ house :: broker state
|
||||
$: stories/(map knot story) :: conversations
|
||||
remotes/(map partner atlas) :: remote presence
|
||||
mirrors/(map station config) :: remote config
|
||||
::TODO rename to readers?
|
||||
general/(map bone (set knot)) :: our message readers
|
||||
outbox/(pair @ud (map @ud thought)) :: urbit outbox
|
||||
@ -47,8 +43,11 @@
|
||||
$: count/@ud :: (lent grams)
|
||||
grams/(list telegram) :: all history
|
||||
locals/atlas :: local presence
|
||||
sequence/(map partner @ud) :: partners heard
|
||||
remotes/(map partner atlas) :: remote presence
|
||||
shape/config :: configuration
|
||||
mirrors/(map station config) :: remote config
|
||||
::TODO never gets updated. ::
|
||||
sequence/(map partner @ud) :: partners heard
|
||||
known/(map serial @ud) :: messages heard
|
||||
followers/(map bone river) :: subscribers
|
||||
== ::
|
||||
@ -505,21 +504,23 @@
|
||||
=. +>.$ ::TODO =?
|
||||
?: (~(has by general) new) +>.$
|
||||
%- ra-emil
|
||||
:~ ::x remote configurations
|
||||
[new %diff %talk-lowdown %confs (~(run by mirrors) some)]
|
||||
::x remote presences
|
||||
[new %diff %talk-lowdown %precs remotes]
|
||||
::x bound glyphs
|
||||
:~ ::x bound glyphs
|
||||
[new %diff %talk-lowdown %glyph nak]
|
||||
::x nicknames
|
||||
[new %diff %talk-lowdown %names (~(run by folks) some)]
|
||||
==
|
||||
=. +>.$ ::TODO =?
|
||||
?. (~(has by stories) sor) +>.$
|
||||
%- ra-emit
|
||||
=+ soy=(~(got by stories) sor)
|
||||
%- ra-emil
|
||||
:~ ::x configurations
|
||||
:* new %diff %talk-lowdown %confs
|
||||
`shape.soy (~(run by mirrors.soy) some)
|
||||
==
|
||||
::x presences
|
||||
[new %diff %talk-lowdown %precs locals.soy remotes.soy]
|
||||
::x messages
|
||||
:* new %diff %talk-lowdown %grams sor 0
|
||||
grams:(~(got by stories) sor)
|
||||
[new %diff %talk-lowdown %grams 0 grams.soy]
|
||||
==
|
||||
%= +>.$
|
||||
general
|
||||
@ -690,7 +691,7 @@
|
||||
%+ murn (~(tap by general))
|
||||
|= {b/bone s/(set knot)}
|
||||
^- (unit move)
|
||||
?: &(=(%grams -.low) !(~(has in s) man)) ~
|
||||
?. (~(has in s) man) ~
|
||||
`[b %diff %talk-lowdown low]
|
||||
moves
|
||||
+>.$
|
||||
@ -728,7 +729,7 @@
|
||||
=+ old=mirrors
|
||||
=. mirrors (~(put by mirrors) cuz con)
|
||||
?: =(mirrors old) +>.$
|
||||
=. +>.$ (pa-inform %confs (strap cuz `con))
|
||||
=. +>.$ (pa-inform %confs `shape (strap cuz `con))
|
||||
(pa-report-cabal pa-followers)
|
||||
::
|
||||
++ pa-diff-talk-report :: subscribed update
|
||||
@ -753,8 +754,7 @@
|
||||
^+ +>
|
||||
?. (~(has in sources.shape) tay) +>
|
||||
=. sources.shape (~(del in sources.shape) tay)
|
||||
=. mirrors (~(put by mirrors) [our.hid man] shape)
|
||||
=. +> (pa-inform %confs (strap [our.hid man] `shape))
|
||||
=. +> (pa-inform %confs `shape ~)
|
||||
(pa-report-cabal pa-followers)
|
||||
::
|
||||
++ pa-sauce :: send backward
|
||||
@ -789,7 +789,7 @@
|
||||
==
|
||||
::
|
||||
++ pa-acquire :: subscribe to
|
||||
::x for each partner, produce a %peer/subscribe move.
|
||||
::x subscribe this story to the partners.
|
||||
::
|
||||
|= tal/(list partner)
|
||||
%+ pa-sauce 0 ::x subscription is caused by this app
|
||||
@ -817,7 +817,7 @@
|
||||
::x partners we gained/lost, and send out an updated cabal report.
|
||||
::
|
||||
|= cof/config
|
||||
=. +>.$ (pa-inform %confs (strap [our.hid man] `cof))
|
||||
=. +>.$ (pa-inform %confs `cof ~)
|
||||
=+ ^= dif ^- (pair (list partner) (list partner))
|
||||
=+ old=`(list partner)`(~(tap in sources.shape) ~)
|
||||
=+ new=`(list partner)`(~(tap in sources.cof) ~)
|
||||
@ -826,13 +826,11 @@
|
||||
=. +>.$ (pa-acquire p.dif)
|
||||
=. +>.$ (pa-abjure q.dif)
|
||||
=. shape cof
|
||||
=. mirrors (~(put by mirrors) [our.hid man] cof)
|
||||
(pa-report-cabal pa-followers)
|
||||
::
|
||||
++ pa-reform-gone
|
||||
=. stories (~(del by stories) man)
|
||||
=. mirrors (~(del by mirrors) [our.hid man])
|
||||
=. . (pa-inform %confs (strap [our.hid man] ~))
|
||||
=. . (pa-inform %confs ~ ~)
|
||||
=. . (pa-report-cabal pa-followers)
|
||||
(pa-abjure (~(tap in sources.shape)))
|
||||
::
|
||||
@ -849,8 +847,7 @@
|
||||
^+ +>
|
||||
=/ nol (~(put by locals) her saz)
|
||||
?: =(nol locals) +>.$
|
||||
=. +>.$ (pa-inform %precs (strap [%& our.hid man] (strap her saz)))
|
||||
=/ ner (~(put by remotes) [%& our.hid man] nol)
|
||||
=. +>.$ (pa-inform %precs (strap her saz) ~)
|
||||
(pa-report-group(locals nol) pa-followers)
|
||||
::
|
||||
++ pa-remind :: remote presence
|
||||
@ -863,7 +860,7 @@
|
||||
=/ buk (~(uni by remotes) rem) ::TODO drop?
|
||||
=. buk (~(put by buk) tay loc)
|
||||
?: =(buk remotes) +>.$
|
||||
=. +>.$ (pa-inform %precs (~(dif in buk) remotes))
|
||||
=. +>.$ (pa-inform %precs ~ (~(dif in buk) remotes))
|
||||
(pa-report-group(remotes buk) pa-followers)
|
||||
::
|
||||
++ pa-start :: start stream
|
||||
@ -933,7 +930,7 @@
|
||||
|= {num/@ud gam/telegram}
|
||||
^+ +>
|
||||
::x notify the interested readers.
|
||||
=. +> (pa-inform %grams man num gam ~)
|
||||
=. +> (pa-inform %grams num gam ~)
|
||||
::x notify only the followers who are currently interested.
|
||||
=+ ^= moy
|
||||
|- ^- (pair (list bone) (list move))
|
||||
|
@ -56,26 +56,27 @@
|
||||
$? $black :: channel, blacklist
|
||||
$white :: village, whitelist
|
||||
$green :: journal, author list
|
||||
$brown :: mailbox, our + black
|
||||
$brown :: mailbox, our r, bl w
|
||||
== ::
|
||||
++ presence ?($gone $hear $talk) :: status type
|
||||
++ register (pair atlas (map partner atlas)) :: ping me, ping srcs
|
||||
++ shelf (map knot (pair posture cord)) :: ship shape
|
||||
++ report :: talk update
|
||||
$% {$cabal cabal} :: config neighborhood
|
||||
$% :: relevant story is determined from wire: reader responsibility.
|
||||
{$cabal cabal} :: config neighborhood
|
||||
:: {$folder (list report)} :: multiple
|
||||
{$grams (pair @ud (list telegram))} :: beginning thoughts
|
||||
{$group register} :: presence
|
||||
== ::
|
||||
++ lowdown :: changed shared state
|
||||
::TODO change these so that they're always just the diff?
|
||||
:: re-check existing implementations too!
|
||||
:: this will aid with ++sh's printing.
|
||||
$% {$glyph (jug char (set partner))} :: new bindings
|
||||
$% :: ui state
|
||||
{$glyph (jug char (set partner))} :: new bindings
|
||||
{$names (map ship (unit human))} :: new identities
|
||||
{$confs (map station (unit config))} :: changed configs
|
||||
{$precs (map partner atlas)} :: changed presences
|
||||
{$grams (trel knot @ud (list telegram))} :: new grams
|
||||
:: story state
|
||||
:: relevant story is determined from wire: reader responsibility.
|
||||
{$confs (unit config) (map station (unit config))}:: changed configs
|
||||
{$precs register} :: changed presences
|
||||
{$grams (pair @ud (list telegram))} :: new grams
|
||||
== ::
|
||||
++ speech :: narrative action
|
||||
$% {$lan p/knot q/@t} :: local announce
|
||||
|
Loading…
Reference in New Issue
Block a user