diff --git a/app/hall.hoon b/app/hall.hoon index 1d6962d07..2a7e2ad21 100644 --- a/app/hall.hoon +++ b/app/hall.hoon @@ -30,9 +30,9 @@ :> state data structures +| ++ state :> application state - $: stories/(map naem story) :< conversations + $: stories/(map name story) :< conversations outbox/(map serial tracking) :< sent messages - log/(map naem @ud) :< logged to clay + log/(map name @ud) :< logged to clay nicks/(map ship nick) :< local nicknames binds/(jug char audience) :< circle glyph lookup public/(set circle) :< publicly member of @@ -68,13 +68,13 @@ {$glyph diff-glyph} :< un/bound glyph {$nick diff-nick} :< changed nickname :: story state :: - {$story nom/naem det/delta-story} :< change to story + {$story nom/name det/delta-story} :< change to story :: side-effects :: {$init $~} :< initialize {$observe who/ship} :< watch burden bearer $: $present :> send %present cmd hos/ship :: - nos/(set naem) :: + nos/(set name) :: dif/diff-status :: == :: == :: @@ -108,7 +108,7 @@ == :: ++ weir :> parsed wire $% {$repeat cir/circle ses/(list serial)} :< messaging wire - {$circle nom/naem src/source} :< subscription wire + {$circle nom/name src/source} :< subscription wire == :: -- :: @@ -221,7 +221,7 @@ :> {nom} exists, calls the gate with a story core. :> if it doesn't, does nothing. :: - |= nom/naem + |= nom/name |= fun/$-(_so _ta) ^+ +>+> =+ pur=(~(get by stories) nom) @@ -243,11 +243,11 @@ :: :: create default circles. => %+ roll - ^- (list {security naem cord}) + ^- (list {security name cord}) :~ [%mailbox %inbox 'default home'] [%journal %public 'visible activity'] == - |= {{typ/security nom/naem des/cord} _ta} + |= {{typ/security nom/name des/cord} _ta} (ta-action [%create nom des typ]) %- ta-deltas :: if needed, subscribe to our parent's /burden. @@ -283,7 +283,7 @@ :> sets status for the indicated stories, :> but only if they have write permission there. :: - |= {who/ship nos/(set naem) dif/diff-status} + |= {who/ship nos/(set name) dif/diff-status} ^+ +> =+ nol=~(tap in nos) |- @@ -340,7 +340,7 @@ :> store a delta about a story. if the story :> does not exist, crash. :: - |= {nom/naem det/delta-story} + |= {nom/name det/delta-story} ?: (~(has by stories) nom) (impact nom det) (ta-evil (crip "no story {(trip nom)}")) @@ -350,7 +350,7 @@ :> :> Store a delta about a story. :: - |= {nom/naem det/delta-story} + |= {nom/name det/delta-story} (ta-delta %story nom det) :: ++ present @@ -359,25 +359,17 @@ |= {aud/audience dif/diff-status} ^+ ..ta-action =/ cic - ^- (jug ship naem) + ^- (jug ship name) %- ~(rep in aud) - |= {c/circle m/(jug ship naem)} + |= {c/circle m/(jug ship name)} (~(put ju m) hos.c nom.c) =? ..ta-action (~(has by cic) our.bol) =+ nos=~(tap in (~(get ju cic) our.bol)) - |- ^+ ..ta-action - ?~ nos ..ta-action - =. ..ta-action - (affect i.nos %status [our.bol i.nos] our.bol dif) - $(nos t.nos) - ::TODO runtime error - ::%- ~(rep in (~(get ju cic) our.bol)) - ::|= {n/naem _ta} :: beware, urbit/arvo#447 - ::(affect n %status [our.bol n] our.bol dif) + (ta-present our.bol (~(get ju cic) our.bol) dif) =. cic (~(del by cic) our.bol) %- ta-deltas %- ~(rep by cic) - |= {{h/ship s/(set naem)} l/(list delta)} + |= {{h/ship s/(set name)} l/(list delta)} :_ l [%present h s dif] :: @@ -386,7 +378,7 @@ ++ action-create :> creates a story with the specified parameters. :: - |= {nom/naem des/cord typ/security} + |= {nom/name des/cord typ/security} ^+ ..ta-action ?. (~(has in stories) nom) %^ impact nom %new @@ -405,7 +397,7 @@ :> delete story {nom}, optionally announcing the :> event with message {mes}. :: - |= {nom/naem mes/(unit cord)} + |= {nom/name mes/(unit cord)} ^+ ..ta-action =? ..ta-action ?=(^ mes) %+ action-phrase @@ -416,7 +408,7 @@ ++ action-depict :> change description of story {nom} to {des}. :: - |= {nom/naem cap/cord} + |= {nom/name cap/cord} (affect nom %config [our.bol nom] %caption cap) :: ++ action-filter @@ -425,13 +417,13 @@ :> replaces the story's current filter with the :> specified one. :: - |= {nom/naem fit/filter} + |= {nom/name fit/filter} (affect nom %config [our.bol nom] %filter fit) :: ++ action-permit :> invite to/banish from story {nom} all {sis}. :: - |= {nom/naem inv/? sis/(set ship)} + |= {nom/name inv/? sis/(set ship)} =+ soy=(~(get by stories) nom) ?~ soy (ta-evil (crip "no story {(trip nom)}")) @@ -440,7 +432,7 @@ ++ action-source :> add/remove {pos} as sources for story {nom}. :: - |= {nom/naem sub/? srs/(set source)} + |= {nom/name sub/? srs/(set source)} =+ soy=(~(get by stories) nom) ?~ soy (ta-evil (crip "no story {(trip nom)}")) @@ -557,7 +549,7 @@ :> :> store a started subscription as source. :: - |= {nom/naem src/source} + |= {nom/name src/source} %- (ta-know nom) |= sor/_so =< so-done (so-greet:sor src) :: @@ -566,7 +558,7 @@ :> :> removes {src} from story {nom}'s sources. :: - |= {nom/naem src/source} + |= {nom/name src/source} %- (ta-know nom) |= sor/_so =< so-done (so-leave:sor src) :: @@ -599,7 +591,7 @@ $(sos t.sos) ::TODO runtime error ::%+ roll ~(tap by sos.piz) - ::|= {{n/naem b/burden} _..ta-take} + ::|= {{n/name b/burden} _..ta-take} ::=+ (fall (~(get by stories) n) *story) ::so-done:(~(so-bear so n ~ -) b) :: @@ -673,7 +665,7 @@ :> when a subscription gets dropped by gall, we :> resubscribe. :: - |= {nom/naem src/source} + |= {nom/name src/source} ^+ +> %- (ta-know nom) |= sor/_so =< so-done (so-resub:sor src) @@ -730,7 +722,7 @@ :> :> add or update telegram {gam} in story {nom}. :: - |= {nom/naem gam/telegram} + |= {nom/name gam/telegram} %- (ta-know nom) |= sor/_so =< so-done (so-learn:sor [our.bol nom] gam) :: @@ -754,7 +746,7 @@ :> acs: hall actions issued due to changes. :: story is faceless to ease data access. :: - $: nom/naem + $: nom/name acs/(list action) story == @@ -1024,12 +1016,19 @@ ^+ +> :: only have presence if you have write permission. ?. |((so-admire who) ?=($remove -.dif)) +> - :: ignore if it won't result in change. + :: ignore if it won't result in change, + :: or if it sets an impersonating handle. ?. ?: ?=($remove -.dif) (~(has by locals) who) ?| !(~(has by locals) who) :: - =+ (~(got by locals) who) - !=(- (change-status - dif)) + =+ old=(~(got by locals) who) + =+ new=(change-status - dif) + ?& !=(old new) + :: + ?= $~ + (rush (fall han.man.new '') ;~(pfix sig fed:ag)) + ::TODO calling with %+ gives syntax error + == == +> (so-delta-our %status so-cir who dif) @@ -1458,7 +1457,7 @@ ++ da-present :> send %present cmd :: - |= {hos/ship nos/(set naem) dif/diff-status} + |= {hos/ship nos/(set name) dif/diff-status} ^+ +> %- da-emit :* ost.bol @@ -1611,7 +1610,7 @@ :> in case of a new or deleted story, specialized :> arms are called. :: - |= {nom/naem det/delta-story} + |= {nom/name det/delta-story} ^+ +> ?+ -.det =< sa-done @@ -1629,7 +1628,7 @@ :> :> creates story {nom} with config {con}. :: - |= {nom/naem cof/config} + |= {nom/name cof/config} ^+ +> =< sa-done %- ~(sa-change sa nom *story) @@ -1640,7 +1639,7 @@ :> :> calls the story core to delete story {nom}. :: - |= nom/naem + |= nom/name ^+ +> =. +> %- da-emil @@ -1655,7 +1654,7 @@ |_ :> nom: story name in {stories}. :: story is faceless to ease data access. :: - $: nom/naem + $: nom/name story == :> # %resolve @@ -1979,7 +1978,7 @@ :> constructs a /circle %peer path for subscribing :> {nom} to a source. :: - |= {nom/naem wat/(list circle-data) source} + |= {nom/name wat/(list circle-data) source} ^- wire ;: weld /circle/[nom]/(scot %p hos.cir)/[nom.cir] @@ -2050,7 +2049,7 @@ :: |= $: wir/wire $= fun - $- {nom/naem src/source} + $- {nom/name src/source} {(list move) _.} == =+ wer=(etch wir) @@ -2088,7 +2087,7 @@ ?. =(who our.bol) [bon %quit ~]~ %- zing %+ turn ~(tap in ~(key by stories)) - |= n/naem + |= n/name ^- (list move) :~ :^ 0 %poke / :+ [our.bol dap.bol] %hall-action @@ -2132,6 +2131,15 @@ ::[:(welp m mos (affection d)) +>.^$] :: ++ peek + |= pax/path + ?> ?=({$x *} pax) :: others unsupported. + ^- (unit (unit (pair mark prize))) + =+ piz=(look (path-to-query t.pax)) + ?~ piz ~ + ?~ u.piz [~ ~] + ``[%hall-prize u.u.piz] +:: +++ look :> query on state :> :> find the result (if any) for a given query. @@ -2144,10 +2152,10 @@ :: $circles =- ``[%circles -] - %- ~(gas in *(set naem)) + %- ~(gas in *(set name)) %+ murn ~(tap by stories) - |= {n/naem s/story} - ^- (unit naem) + |= {n/name s/story} + ^- (unit name) ?:((~(so-visible so:ta n ~ s) who.qer) `n ~) :: $public @@ -2156,10 +2164,10 @@ $burden :+ ~ ~ :- %burden - %- ~(gas in *(map naem burden)) + %- ~(gas in *(map name burden)) %+ murn ~(tap by stories) - |= {n/naem s/story} - ^- (unit (pair naem burden)) + |= {n/name s/story} + ^- (unit (pair name burden)) :: only auto-federate channels for now. ?. ?=($channel sec.con.shape.s) ~ :+ ~ n @@ -2209,7 +2217,7 @@ :> modify a %story diff to make it about their ship :> instead of ours. :: - |= {who/ship nom/naem det/delta-story} + |= {who/ship nom/name det/delta-story} ^- rumor-story ?+ -.det det :: @@ -2251,7 +2259,7 @@ :> for a given story. assumes both story and :> telegram are known. :: - |= {nom/naem gam/telegram} + |= {nom/name gam/telegram} ^- envelope :_ gam %. uid.gam @@ -2261,7 +2269,7 @@ :: |= $: wer/(unit circle) wat/(set circle-data) - nom/naem + nom/name det/delta-story == ^- ? @@ -2598,7 +2606,7 @@ %- pre-bake ta-done:(ta-subscribe:ta src.bol qer) :_ +>.$ - =+ piz=(peek qer) + =+ piz=(look qer) ?~ piz ~&([%query-unavailable pax] mos) ?~ u.piz ~&([%query-invalid pax] mos) :_ mos @@ -2665,7 +2673,7 @@ |= wir/wire ^- (quip move _+>) %+ etch-circle [%circle wir] - |= {nom/naem src/source} + |= {nom/name src/source} %- pre-bake ta-done:(ta-resub:ta nom src) :: @@ -2694,7 +2702,7 @@ :> to be re-loaded by ++poke-hall-load. ::TODO maybe update to also store sourced list. :: - |= nom/naem + |= nom/name ^- (quip move _+>) =/ paf/path /(scot %p our.bol)/home/(scot %da now.bol)/hall/[nom]/hall-telegrams @@ -2711,7 +2719,7 @@ ++ poke-load-legacy :> loads legacy messages into the story {nom}. :: - |= nom/naem + |= nom/name ^- (quip move _+>) =/ jams/json .^ json @@ -2731,7 +2739,7 @@ :> loads the telegrams of story {nom} into our state, :> as saved in ++poke-hall-save. :: - |= nom/naem + |= nom/name ^- (quip move _+>) =/ grams .^ (list telegram) @@ -2746,7 +2754,7 @@ ++ poke-hall-log :> starts logging story {nom}'s messages. :: - |= nom/naem + |= nom/name ^- (quip move _+>) :- [(log-to-file nom) ~] %= +>.$ @@ -2758,7 +2766,7 @@ ++ poke-hall-unlog :> stops logging story {nom}'s messages. :: - |= nom/naem + |= nom/name ^- (quip move _+>) :- ~ +>.$(log (~(del by log) nom)) @@ -2773,11 +2781,11 @@ :_ %_ . log %- ~(urn by log) - |= {nom/naem len/@ud} + |= {nom/name len/@ud} count:(~(got by stories) nom) == %+ murn ~(tap by log) - |= {nom/naem len/@ud} + |= {nom/name len/@ud} ^- (unit move) ?: (gte len count:(~(got by stories) nom)) ~ @@ -2786,7 +2794,7 @@ ++ log-to-file :> logs all grams of story {nom} to a file. :: - |= nom/naem + |= nom/name ^- move =+ ^- paf/path =+ day=(year %*(. (yore now.bol) +.t +:*tarp)) @@ -2809,7 +2817,7 @@ ~& 'verifying message reference integrity...' =- ~&(- [~ +>.$]) %- ~(urn by stories) - |= {n/naem s/story} + |= {n/name s/story} =+ %- ~(rep by known.s) |= {{u/serial a/@ud} k/@ud m/@ud} :- ?:((gth a k) a k) @@ -2829,7 +2837,7 @@ ~& 'rebuilding message references...' =- [~ +>.$(stories -)] %- ~(urn by stories) - |= {nom/naem soy/story} + |= {nom/name soy/story} =+ %+ roll grams.soy |= {t/telegram c/@ud k/(map serial @ud) s/(map circle (list @ud))} :+ +(c) (~(put by k) uid.t c) @@ -2857,7 +2865,7 @@ ?: =(a 'sources') ~& 'sources per story:' ~& %- ~(urn by stories) - |= {n/naem s/story} + |= {n/name s/story} [n src.shape.s] [~ +>] [~ +>] diff --git a/app/talk.hoon b/app/talk.hoon index 37259d3e4..c695479cd 100644 --- a/app/talk.hoon +++ b/app/talk.hoon @@ -69,14 +69,14 @@ $% :: circle management :: {$join (map circle range)} :< subscribe to {$leave audience} :< unsubscribe from - {$create security naem cord} :< create circle - {$delete naem (unit cord)} :< delete circle - {$depict naem cord} :< change description - {$filter naem ? ?} :< change message rules - {$invite naem (set ship)} :< give permission - {$banish naem (set ship)} :< deny permission - {$source naem (map circle range)} :< add source - {$unsource naem (map circle range)} :< remove source + {$create security name cord} :< create circle + {$delete name (unit cord)} :< delete circle + {$depict name cord} :< change description + {$filter name ? ?} :< change message rules + {$invite name (set ship)} :< give permission + {$banish name (set ship)} :< deny permission + {$source name (map circle range)} :< add source + {$unsource name (map circle range)} :< remove source :: personal metadata :: {$attend audience (unit presence)} :< set our presence {$name audience human} :< set our name @@ -89,7 +89,8 @@ {$number $@(@ud {@u @ud})} :< relative/absolute {$who audience} :< presence {$what (unit $@(char audience))} :< show bound glyph - {$sources circle} :< show active sources + {$circles $~} :< show our circles + {$sources circle} :< show active sources :: ui settings :: {$bind char (unit audience)} :< bind glyph {$unbind char (unit audience)} :< unbind glyph @@ -132,20 +133,20 @@ :> small utility functions. +| :: -++ our +++ self (true-self our.bol) :: ++ server :> our hall instance ^- dock - [our %hall] + [self %hall] :: ++ inbox :> client's circle name :> :> produces the name of the circle used by this :> client for all its operations - ^- naem + ^- name %inbox :: ++ incir @@ -153,7 +154,7 @@ :> :> ++inbox, except a full circle. ^- circle - [our inbox] + [self inbox] :: ++ renum :> find the grams list index for gram with serial. @@ -215,7 +216,9 @@ %peer /server/inbox server - /circle/[inbox]/grams/config/group/(scot %ud count) + :: + %+ welp /circle/[inbox]/grams/config/group + ?:(=(0 count) ~ [(scot %ud count) ~]) == :: :> # @@ -368,22 +371,25 @@ ?& ?=($source -.dif.rum) add.dif.rum =(cir.rum incir) - ?=($~ ran.src.dif.rum) == =* cir cir.src.dif.rum =+ ren=~(cr-phat cr cir) =+ gyf=(~(get by bound) [cir ~ ~]) =< sh-done - => :_ . - %- ~(sh-act sh cli) - [%notify [cir ~ ~] `%hear] + =/ sho + :: only present if we're here indefinitely. + =* ran ran.src.dif.rum + ?. |(?=($~ ran) ?=($~ tal.u.ran)) + ~(. sh cli) + %- ~(sh-act sh cli) + [%notify [cir ~ ~] `%hear] ?^ gyf - (sh-note "has glyph {[u.gyf ~]} for {ren}") + (sh-note:sho "has glyph {[u.gyf ~]} for {ren}") :: we use the rendered circle name to determine :: the glyph for higher glyph consistency when :: federating. =+ cha=(glyph (mug ren)) - (sh-work %bind cha `[cir ~ ~]) + (sh-work:sho %bind cha `[cir ~ ~]) %= +>.$ sources ?. &(?=($source -.dif.rum) =(cir.rum incir)) @@ -629,13 +635,13 @@ (most ;~(plug com (star ace)) ship) :: ++ cire :< local circle - ;~(pfix cen sym) + ;~(pfix cen urs:ab) :: ++ circ :< circle ;~ pose (cold incir col) - ;~(pfix cen (stag our sym)) - ;~(pfix fas (stag (sein:title our) sym)) + ;~(pfix cen (stag self urs:ab)) + ;~(pfix fas (stag (sein:title self) urs:ab)) :: %+ cook |= {a/@p b/(unit term)} @@ -765,7 +771,7 @@ == :: ;~ plug (perk %delete ~) - ;~(pfix ;~(plug ace cen) sym) + ;~(pfix ace cire) ;~ pose (cook some ;~(pfix ace qut)) (easy ~) @@ -824,6 +830,8 @@ (easy ~) == == + :: + ;~(plug (perk %circles ~) (easy ~)) :: ;~((glue ace) (perk %sources ~) circ) :: @@ -944,15 +952,12 @@ %. u.jub =< sh-work =+ buf=buf.say.she + =? ..sh-obey &(?=({$';' *} buf) !?=($reply -.u.jub)) + (sh-note (tufa `(list @)`buf)) =^ cal say.she (~(transmit sole say.she) [%set ~]) - %- sh-fact - :* %mor - [%nex ~] + %+ sh-fact %mor + :~ [%nex ~] [%det cal] - ?. ?=({$';' *} buf) ~ - ?: ?=($reply -.u.jub) ~ - :_ ~ - [%txt (runt [14 '-'] `tape`['|' ' ' (tufa `(list @)`buf)])] == :: :> # @@ -994,7 +999,7 @@ $unsource (source | +.job) :: personal metadata $attend (attend +.job) - $name (name +.job) + $name (set-name +.job) :: messaging $say (say +.job) $eval (eval +.job) @@ -1004,6 +1009,7 @@ $number (number +.job) $who (who +.job) $what (what +.job) + $circles circles $sources (list-sources +.job) :: ui settings $bind (bind +.job) @@ -1088,7 +1094,7 @@ :: ^- vase !> ^- {our/@p now/@da eny/@uvI} - [our now.bol (shas %eny eny.bol)] + [self now.bol (shas %eny eny.bol)] :: :> # :> # %circle-management @@ -1141,11 +1147,11 @@ :> :> creates circle {nom} with specified config. :: - |= {sec/security nom/naem txt/cord} + |= {sec/security nom/name txt/cord} ^+ ..sh-work =. ..sh-work (sh-act %create nom txt sec) - (join [[[our nom] ~] ~ ~]) + (join [[[self nom] ~] ~ ~]) :: ++ delete :> %delete @@ -1153,7 +1159,7 @@ :> deletes our circle {nom}, after optionally :> sending a last announce message {say}. :: - |= {nom/naem say/(unit cord)} + |= {nom/name say/(unit cord)} ^+ ..sh-work (sh-act %delete nom say) :: @@ -1162,7 +1168,7 @@ :> :> changes the description of {nom} to {txt}. :: - |= {nom/naem txt/cord} + |= {nom/name txt/cord} ^+ ..sh-work (sh-act %depict nom txt) :: @@ -1172,12 +1178,12 @@ :> invites or banishes {sis} to/from our :> circle {nom}. :: - |= {inv/? nom/naem sis/(set ship)} + |= {inv/? nom/name sis/(set ship)} ^+ ..sh-work (sh-act %permit nom inv sis) :: ++ filter - |= {nom/naem cus/? utf/?} + |= {nom/name cus/? utf/?} ^+ ..sh-work (sh-act %filter nom cus utf) :: @@ -1186,7 +1192,7 @@ :> :> adds {pas} to {nom}'s src. :: - |= {sub/? nom/naem pos/(map circle range)} + |= {sub/? nom/name pos/(map circle range)} ^+ ..sh-work (sh-act %source nom sub pos) :: @@ -1202,7 +1208,7 @@ ^+ ..sh-work (sh-act %notify aud pec) :: - ++ name + ++ set-name :> sets our name to {man} for {aud}. :: |= {aud/audience man/human} @@ -1329,7 +1335,7 @@ (sh-lame "{(scow %s (new:si | +(num)))}: no such telegram") =. ..sh-fact (sh-fact %txt "? {(scow %s (new:si | +(num)))}") (activate (snag num grams)) - ?. (gth q.num count) + ?. (gte q.num count) ?: =(count 0) (sh-lame "0: no messages") =+ msg=(deli (dec count) num) @@ -1337,6 +1343,21 @@ (activate (snag (sub count +(msg)) grams)) (sh-lame "…{(reap p.num '0')}{(scow %ud q.num)}: no such telegram") :: + ++ circles + :> %circles + :> + :> list all local circles. + :: + ^+ ..sh-work + =/ piz + =- .^(prize %gx -) + %+ weld /(scot %p our.bol)/hall/(scot %da now.bol) + /circles/(scot %p our.bol)/hall-prize + ?> ?=($circles -.piz) + %+ sh-fact %mor + %+ turn (sort ~(tap in cis.piz) lth) + |= a/name [%txt "%{(trip a)}"] + :: ++ list-sources :> %sources :> @@ -1697,9 +1718,12 @@ :: |= txt/tape ^+ +> - %+ sh-fact %txt - %+ runt [14 '-'] - `tape`['|' ' ' (scag (sub width.she 16) txt)] + =+ lis=(simple-wrap txt (sub width.she 16)) + %+ sh-fact %mor + =+ ?:((gth (lent lis) 0) (snag 0 lis) "") + :- txt+(runt [14 '-'] '|' ' ' -) + %+ turn (slag 1 lis) + |=(a/tape txt+(runt [14 ' '] '|' ' ' a)) :: ++ sh-prod :> show prompt @@ -1727,7 +1751,7 @@ ?~ lis +>.$ %+ sh-fact %mor %+ turn `(list tape)`lis - =+ nom=(scag 7 (cite:title our)) + =+ nom=(scag 7 (cite:title self)) |= t/tape ?. ?& (~(has in settings.she) %notify) ?=(^ (find nom (slag 15 t))) @@ -1864,7 +1888,6 @@ ^+ +> ?~ gaz +> $(gaz t.gaz, +> (sh-gram i.gaz)) - :: -- -- :: @@ -1892,8 +1915,8 @@ |= two/circle ^- ? :: the circle that's ours is better. - ?: =(our hos.one) - ?. =(our hos.two) & + ?: =(self hos.one) + ?. =(self hos.two) & ?< =(nom.one nom.two) :: if both circles are ours, the main story is better. ?: =(%inbox nom.one) & @@ -1901,7 +1924,7 @@ :: if neither are, pick the "larger" one. (lth nom.one nom.two) :: if one isn't ours but two is, two is better. - ?: =(our hos.two) | + ?: =(self hos.two) | ?: =(hos.one hos.two) :: if they're from the same ship, pick the "larger" one. (lth nom.one nom.two) @@ -1957,14 +1980,14 @@ ::> "/channel" for parent circle. :: ^- tape - ?: =(hos.one our) + ?: =(hos.one self) ?: =(nom.one inbox) ":" ['%' (trip nom.one)] =+ wun=(cite:title hos.one) ?: =(nom.one %inbox) wun - ?: =(hos.one (sein:title our)) + ?: =(hos.one (sein:title self)) ['/' (trip nom.one)] :(welp wun "/" (trip nom.one)) :: @@ -2060,7 +2083,7 @@ :> returns true if circle is a mailbox of ours. :: |= cir/circle ^- ? - ?& =(hos.cir our) + ?& =(hos.cir self) =+ sot=(~(get by mirrors) cir) &(?=(^ sot) ?=($mailbox sec.con.u.sot)) == @@ -2196,12 +2219,15 @@ mor+~[txt+"# {(trip exp.sep)}" tan+res.sep] :: $ire - =+ gam=(recall top.sep) - ?~ gam $(sep sep.sep) + =+ num=(~(get by known) top.sep) + ?~ num $(sep sep.sep) + =+ gam=(snag (sub count +(u.num)) grams) =- mor+[tan+- $(sep sep.sep) ~] %- flop %+ weld - [%leaf "in reply to: {(cite:title aut.u.gam)}: "]~ - %+ turn (~(tr-text tr sef u.gam) width.cli) + :_ ~ :- %leaf + %+ weld "in reply to: {(cite:title aut.gam)}: " + "[{(scow %ud u.num)}]" + %+ turn (~(tr-text tr sef gam) width.cli) |=(t/tape [%leaf t]) :: $fat @@ -2313,20 +2339,18 @@ ?: pat.sep " " =- (weld - q:(fall pre [p=| q=" "])) %~ ar-glyf ar - ?: =(who our) aud + ?: =(who self) aud (~(del in aud) [who %inbox]) == - =. wyd (sub wyd (min (div wyd 2) (lent pef))) - =/ txt (tuba (trip msg.sep)) - |- ^- (list tape) - ?~ txt ~ - =+ ^- {end/@ud nex/?} - ?: (lte (lent txt) wyd) [(lent txt) &] - =+ ace=(find " " (flop (scag +(wyd) `(list @c)`txt))) - ?~ ace [wyd |] - [(sub wyd u.ace) &] - :- (weld pef (tufa (scag end `(list @c)`txt))) - $(txt (slag ?:(nex +(end) end) `(list @c)`txt), pef (reap (lent pef) ' ')) + =/ lis/(list tape) + %+ simple-wrap + `tape``(list @)`(tuba (trip msg.sep)) + (sub wyd (min (div wyd 2) (lent pef))) + =+ lef=(lent pef) + =+ ?:((gth (lent lis) 0) (snag 0 lis) "") + :- (weld pef -) + %+ turn (slag 1 lis) + |=(a/tape (runt [lef ' '] a)) :: $inv :_ ~ @@ -2362,12 +2386,12 @@ :: |= pax/path ^- (quip move _+>) - ?. (team:title src.bol our.bol) - ~& [%peer-talk-stranger src.bol] - [~ +>] + ?. =(src.bol our.bol) + ~! [%peer-talk-stranger src.bol] + !! ?. ?=({$sole *} pax) - ~& [%peer-talk-strange pax] - [~ +>] + ~! [%peer-talk-strange pax] + !! ta-done:ta-console:ta :: ++ diff-hall-prize diff --git a/lib/hall-json.hoon b/lib/hall-json.hoon index 78065687c..bcdb7697d 100644 --- a/lib/hall-json.hoon +++ b/lib/hall-json.hoon @@ -29,31 +29,22 @@ ++ de-tape ::> tape to sur (parse) |% ++ circ ::> circle - ;~((glue fas) ;~(pfix sig fed:ag) urt:ab) + ;~((glue fas) ;~(pfix sig fed:ag) urs:ab) :: - ++ rang ::> range - =/ pont - ;~ pose - (stag %ud dim:ag) - %+ stag %da - %+ sear - |= a/coin - ^- (unit @da) - ?. ?=({$$ $da @da} a) ~ - `q.p.a - nuck:so - == - =+ ;~ pose - (cook some ;~(pfix fas pont)) - (easy ~) + ++ pont + ;~ pfix fas + %+ sear + |= a/coin + ^- (unit place) + ?+ a ~ + {$$ $da @da} `p.a + {$$ $ud @ud} `p.a == - ;~ pose - (cook some ;~(plug ;~(pfix fas pont) -)) - (easy ~) + nuck:so == :: - ++ sorc ::> source - ;~(plug circ rang) + ++ sorc + ;~(plug circ (punt ;~(plug pont (punt pont)))) -- :: ++ enjs ::> sur to json diff --git a/lib/hall.hoon b/lib/hall.hoon index 69cc0c6d2..a543d882c 100644 --- a/lib/hall.hoon +++ b/lib/hall.hoon @@ -44,6 +44,19 @@ ^- {serial _eny.bol} [(shaf %serial eny.bol) (shax eny.bol)] :: +::TODO add to zuse? +++ simple-wrap + |= {txt/tape wyd/@ud} + ^- (list tape) + ?~ txt ~ + =+ ^- {end/@ud nex/?} + ?: (lte (lent txt) wyd) [(lent txt) &] + =+ ace=(find " " (flop (scag +(wyd) `tape`txt))) + ?~ ace [wyd |] + [(sub wyd u.ace) &] + :- (tufa (scag end `(list @)`txt)) + $(txt (slag ?:(nex +(end) end) `tape`txt)) +:: ++ range-to-path :> msg range to path :> diff --git a/sur/hall.hoon b/sur/hall.hoon index 25442a9b9..499799627 100644 --- a/sur/hall.hoon +++ b/sur/hall.hoon @@ -14,7 +14,7 @@ +| :: ::TODO rename -++ naem term :< circle name +++ name term :< circle name ++ nick cord :< local nickname :: :> # @@ -27,11 +27,11 @@ $% {$client $~} :< shared ui state {$circles who/ship} :< readable circles {$public $~} :< public memberships - {$burden who/ship} ::TODO eventually, nom/naem. :< duties to share + {$burden who/ship} ::TODO eventually, nom/name. :< duties to share {$report $~} :< duty reports - {$peers nom/naem} :< readers of story + {$peers nom/name} :< readers of story $: $circle :> story query - nom/naem :< circle name + nom/name :< circle name wer/(unit circle) :< from source wat/(set circle-data) :< data to get ran/range :< query duration @@ -57,9 +57,9 @@ == :: ++ prize :> query result $% {$client prize-client} :< /client - {$circles cis/(set naem)} :< /circles + {$circles cis/(set name)} :< /circles {$public cis/(set circle)} :< /public - {$burden sos/(map naem burden)} :< /burden + {$burden sos/(map name burden)} :< /burden {$report $~} :< /report {$peers pes/(jar ship query)} :< /peers {$circle package} :< /circle @@ -70,9 +70,9 @@ == :: ++ rumor :> query result change $% {$client rum/rumor-client} :< /client - {$circles add/? cir/naem} :< /circles + {$circles add/? cir/name} :< /circles {$public add/? cir/circle} :< /public - {$burden nom/naem rum/rumor-story} :< /burden + {$burden nom/name rum/rumor-story} :< /burden {$peers add/? who/ship qer/query} :< /peers {$circle rum/rumor-story} :< /circle == :: @@ -135,12 +135,12 @@ :: ++ action :> user action $% :: circle configuration :: - {$create nom/naem des/cord sec/security} :< create circle - {$delete nom/naem why/(unit cord)} :< delete + announce - {$depict nom/naem des/cord} :< change description - {$filter nom/naem fit/filter} :< change message rules - {$permit nom/naem inv/? sis/(set ship)} :< invite/banish - {$source nom/naem sub/? srs/(set source)} :< un/sub to/from src + {$create nom/name des/cord sec/security} :< create circle + {$delete nom/name why/(unit cord)} :< delete + announce + {$depict nom/name des/cord} :< change description + {$filter nom/name fit/filter} :< change message rules + {$permit nom/name inv/? sis/(set ship)} :< invite/banish + {$source nom/name sub/? srs/(set source)} :< un/sub to/from src :: messaging :: {$convey tos/(list thought)} :< post exact {$phrase aud/audience ses/(list speech)} :< post easy @@ -162,7 +162,7 @@ :: ++ command :> effect on story $% {$publish tos/(list thought)} :< deliver - {$present nos/(set naem) dif/diff-status} :< status update + {$present nos/(set name) dif/diff-status} :< status update {$bearing $~} :< prompt to listen == :: :: @@ -172,7 +172,7 @@ :> messaging targets and their metadata. +| :: -++ circle {hos/ship nom/naem} :< native target +++ circle {hos/ship nom/name} :< native target :: circle configurations. :: ++ lobby {loc/config rem/(map circle config)} :< our & srcs configs ++ config :> circle config diff --git a/web/talk/main.js b/web/talk/main.js index 38bde4875..256beac4b 100644 --- a/web/talk/main.js +++ b/web/talk/main.js @@ -363,6 +363,7 @@ module.exports = recl({ key: "speech" }, url); case !exp: + exp.res = exp.res || ["evaluating..."]; return div({}, exp.exp, div({ className: "fat" }, pre({}, exp.res.join("\n")))); @@ -1351,6 +1352,9 @@ module.exports = recl({ if (valid === true) { stan = $('#audience .input').text() || util.mainStationPath(window.urb.user); stan = (stan.split(/\ +/)).map(function(v) { + if (v.indexOf("/") === -1) { + v = v + "/inbox"; + } if (v[0] === "~") { return v; } else { @@ -1596,6 +1600,7 @@ module.exports = function(arg) { var path; end = window.urb.util.numDot(end); start = window.urb.util.numDot(start); + console.log('getting grams from ' + end + ' to ' + start); path = util.talkPath('circle', station, 'grams', end, start); return window.urb.bind(path, function(err, res) { var ref, ref1;