2017-03-30 15:17:37 +03:00
|
|
|
:: :: ::
|
2017-03-23 03:34:56 +03:00
|
|
|
:::: /hoon/talk/app :: ::
|
2017-03-30 15:17:37 +03:00
|
|
|
:: :: ::
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
::TODO master changes
|
2017-04-24 21:17:56 +03:00
|
|
|
::TODO char57 comments as line comments when regarding code.
|
2017-03-23 03:34:56 +03:00
|
|
|
::TODO avoid lark where possible
|
2017-04-25 22:09:20 +03:00
|
|
|
::TODO document what user-facing messages actually mean!
|
2017-04-21 00:59:36 +03:00
|
|
|
::TODO ::> to :> etc.
|
2017-04-18 22:33:02 +03:00
|
|
|
::
|
|
|
|
::TODO we can't do away with the default mailbox because we need it for things
|
|
|
|
:: like invite notifications etc. can we do better than request that apps
|
|
|
|
:: don't use it frivolously?
|
2017-04-28 20:40:12 +03:00
|
|
|
::
|
2017-04-18 22:33:02 +03:00
|
|
|
::TODO ".. the importance of the CQRS pattern (command-query separation) behind
|
|
|
|
:: Urbit's separation of %poke and %peer. Pokes (messages) are one-way
|
|
|
|
:: commands, not queries. Peers (subscriptions) have no effect on the
|
|
|
|
:: server state."
|
|
|
|
:: but we *do* change state on-subscribe! is that a problem?
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-30 15:17:37 +03:00
|
|
|
::TODO crash on pokes/peers we do not expect
|
2017-04-21 00:59:36 +03:00
|
|
|
::TODO keep both a folks and nicks maps. (actual profiles and local nicknames.)
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-28 20:40:12 +03:00
|
|
|
/? 151 ::< hoon version
|
2017-04-21 00:59:36 +03:00
|
|
|
/- talk ::< structures
|
2017-04-21 17:14:11 +03:00
|
|
|
/+ talk, time-to-id ::< libraries
|
2017-03-23 03:34:56 +03:00
|
|
|
/= seed /~ !>(.)
|
2017-03-30 15:17:37 +03:00
|
|
|
!:
|
2017-03-23 03:34:56 +03:00
|
|
|
::::
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
[. talk]
|
|
|
|
=> ::> ||
|
|
|
|
::> || %arch
|
|
|
|
::> ||
|
|
|
|
::> data structures
|
|
|
|
::
|
|
|
|
|%
|
2017-04-27 13:15:41 +03:00
|
|
|
++ state ::> broker state
|
2017-04-25 22:18:14 +03:00
|
|
|
$: stories/(map knot story) ::< convercirions
|
2017-04-21 00:59:36 +03:00
|
|
|
readers/(map bone (set knot)) ::< our message readers
|
|
|
|
outbox/(pair @ud (map @ud thought)) ::< urbit outbox
|
|
|
|
log/(map knot @ud) ::< logged to clay
|
|
|
|
folks/(map ship human) ::< human identities
|
2017-04-24 21:17:56 +03:00
|
|
|
nik/(map (set partner) char) ::< bound circle glyphs
|
|
|
|
nak/(jug char (set partner)) ::< circle glyph lookup
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ story ::> wire content
|
|
|
|
$: count/@ud ::< (lent grams)
|
|
|
|
grams/(list telegram) ::< all messages
|
2017-04-27 00:33:25 +03:00
|
|
|
locals/group ::< local presence
|
|
|
|
remotes/(map partner group) ::< remote presence
|
2017-04-21 00:59:36 +03:00
|
|
|
shape/config ::< configuration
|
2017-04-24 21:17:56 +03:00
|
|
|
mirrors/(map circle config) ::< remote config
|
2017-04-12 23:37:37 +03:00
|
|
|
::TODO never gets updated. ::
|
2017-04-21 00:59:36 +03:00
|
|
|
sequence/(map partner @ud) ::< partners heard
|
|
|
|
known/(map serial @ud) ::< messages heard
|
|
|
|
followers/(map bone river) ::< subscribers
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ river (pair point point) ::< stream definition
|
|
|
|
++ point ::> stream endpoint
|
|
|
|
$% {$ud p/@ud} ::< by number
|
|
|
|
{$da p/@da} ::< by date
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ move (pair bone card) ::< all actions
|
|
|
|
++ lime ::> diff fruit
|
2017-03-23 03:34:56 +03:00
|
|
|
$% {$talk-report report} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
{$talk-lowdown lowdown} ::
|
2017-04-10 23:24:25 +03:00
|
|
|
{$talk-reaction reaction} ::
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ pear ::> poke fruit
|
2017-03-23 03:34:56 +03:00
|
|
|
$% {$talk-command command} ::
|
|
|
|
{$write-comment spur ship cord} ::
|
|
|
|
{$write-fora-post spur ship cord cord} ::
|
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ card ::> general card
|
2017-03-23 03:34:56 +03:00
|
|
|
$% {$diff lime} ::
|
2017-05-01 20:34:05 +03:00
|
|
|
{$info wire ship term nori} ::
|
2017-03-23 03:34:56 +03:00
|
|
|
{$peer wire dock path} ::
|
|
|
|
{$poke wire dock pear} ::
|
|
|
|
{$pull wire dock $~} ::
|
|
|
|
{$quit $~} ::
|
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ weir ::> parsed wire
|
2017-05-01 20:34:05 +03:00
|
|
|
$% {$repeat num/@ud hos/ship nom/knot} ::< messaging wire
|
2017-04-27 14:21:17 +03:00
|
|
|
{$friend nom/knot cir/circle} ::< subscription wire
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
|
|
|
--
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %work
|
|
|
|
::> ||
|
|
|
|
::> functional cores and arms.
|
|
|
|
::
|
2017-04-27 13:15:41 +03:00
|
|
|
|_ {bol/bowl state}
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ prep ::< prepare state
|
2017-04-21 17:14:11 +03:00
|
|
|
::> adapts state.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-04-27 13:15:41 +03:00
|
|
|
|= old/(unit state)
|
2017-04-21 00:59:36 +03:00
|
|
|
^- (quip move ..prep)
|
|
|
|
?~ old
|
|
|
|
ta-done:ta-init:ta
|
|
|
|
[~ ..prep(+<+ u.old)]
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %utility
|
|
|
|
::> ||
|
|
|
|
::> small utility functions.
|
|
|
|
::+|
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ strap |*({k/* v/*} (~(put by *(map _k _v)) k v)) ::< map key-value pair
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %engines
|
|
|
|
::> ||
|
|
|
|
::> main cores.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta ::< per transaction
|
|
|
|
::> for every transaction/event (poke, peer, etc.)
|
|
|
|
::> talk-guardian receives, the ++ta transaction core
|
|
|
|
::> is called.
|
|
|
|
::> in processing transactions, ++ta may modify app
|
|
|
|
::> state, or create moves. these moves get produced
|
|
|
|
::> upon finalizing the core's work with ++ta-done.
|
|
|
|
::> when making changes to stories, the ++so core is
|
|
|
|
::> used.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|_ ::> moves: moves created by core operations.
|
|
|
|
::
|
|
|
|
moves/(list move)
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-done ::< resolve core
|
|
|
|
::> produces the moves stored in ++ta's moves.
|
|
|
|
::> they are produced in reverse order because
|
|
|
|
::> ++ta-emil and ++ta-emit add them to the head of
|
|
|
|
::> the {moves}.
|
|
|
|
::
|
|
|
|
^- (quip move +>)
|
|
|
|
[(flop moves) +>]
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-emil ::< emit move list
|
|
|
|
::> adds multiple moves to the head of {moves}.
|
|
|
|
::> flops to stay consistent with ++ta-emit.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= mol/(list move)
|
|
|
|
%_(+> moves (welp (flop mol) moves))
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-emit ::< emit a move
|
|
|
|
::> adds a move to the head of {moves}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= mov/move
|
|
|
|
%_(+> moves [mov moves])
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-inform ::< broadcast lowdown
|
|
|
|
::> sends a talk-lowdown diff to all readers.
|
|
|
|
::
|
|
|
|
|= low/lowdown
|
|
|
|
%- ta-emil
|
|
|
|
%- ~(rep by readers)
|
|
|
|
|= {{b/bone *} l/(list move)}
|
|
|
|
[[b %diff %talk-lowdown low] l]
|
|
|
|
::
|
|
|
|
++ ta-react ::< send reaction
|
|
|
|
::> sends a talk-reaction diff to a reader.
|
|
|
|
::
|
|
|
|
|= {red/bone rac/reaction}
|
|
|
|
%- ta-emit
|
|
|
|
[red %diff %talk-reaction rac]
|
|
|
|
::
|
2017-04-25 14:33:02 +03:00
|
|
|
++ ta-note ::< tell user
|
|
|
|
::> sends {msg} as an %app message to the user's
|
|
|
|
::> inbox.
|
|
|
|
::
|
|
|
|
|= msg/cord
|
2017-04-25 22:09:20 +03:00
|
|
|
%^ ta-action 0 %phrase
|
2017-04-25 14:33:02 +03:00
|
|
|
:- [[%& our.bol (main our.bol)] ~ ~]
|
|
|
|
[%app %talk-guardian msg]~
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-evil ::< emit error
|
|
|
|
::> tracing printf and crash.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= msg/cord
|
2017-04-21 00:59:36 +03:00
|
|
|
~| [%talk-ta-evil msg]
|
2017-03-23 03:34:56 +03:00
|
|
|
!!
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %data
|
|
|
|
::> ||
|
|
|
|
::> utility functions for data retrieval.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-know ::< story monad
|
|
|
|
::> produces a gill that takes a gate.
|
|
|
|
::> if the story {nom} exists, calls the gate with
|
|
|
|
::> a story core. if it doesn't, does nothing.
|
|
|
|
::
|
|
|
|
|= nom/knot
|
2017-04-24 21:17:56 +03:00
|
|
|
|= fun/$-(_so _ta)
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ +>+>
|
|
|
|
=+ pur=(~(get by stories) nom)
|
|
|
|
?~ pur
|
2017-04-25 14:33:02 +03:00
|
|
|
::TODO crash instead?
|
|
|
|
%- ta-note
|
|
|
|
(crip "unknown story '{(trip nom)}'")
|
2017-04-21 00:59:36 +03:00
|
|
|
(fun ~(. so nom ~ u.pur))
|
|
|
|
::
|
|
|
|
++ ta-human ::< look up person
|
|
|
|
::> get {her} identity. if we need to, create one.
|
|
|
|
::
|
|
|
|
|= her/ship
|
|
|
|
^- (quid human +>)
|
|
|
|
=^ who folks
|
|
|
|
=+ who=(~(get by folks) her)
|
|
|
|
?^ who [u.who folks]
|
|
|
|
=+ who=`human`[~ `(scot %p her)] :: XX do right
|
|
|
|
[who (~(put by folks) her who)]
|
|
|
|
[who +>.$]
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %interaction-events
|
|
|
|
::> ||
|
|
|
|
::> arms that apply events we received.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-init ::< initialize app
|
|
|
|
::> populate state on first boot.
|
|
|
|
::> creates our default mailbox and journal.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
%+ roll
|
2017-04-27 00:33:25 +03:00
|
|
|
^- (list {security knot cord})
|
2017-04-21 00:59:36 +03:00
|
|
|
:~ [%brown (main our.bol) 'default home']
|
2017-03-23 03:34:56 +03:00
|
|
|
[%green ~.public 'visible activity']
|
|
|
|
==
|
2017-04-27 00:33:25 +03:00
|
|
|
|= {{typ/security nom/knot des/cord} _ta}
|
2017-04-21 00:59:36 +03:00
|
|
|
%+ ta-action ost.bol
|
|
|
|
[%create nom des typ]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-apply ::< apply command
|
|
|
|
::> applies the command sent by {src}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {src/ship cod/command}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
?- -.cod
|
2017-04-24 21:17:56 +03:00
|
|
|
::> %review commands prompt us (as a circle host)
|
2017-04-21 00:59:36 +03:00
|
|
|
::> to verify and distribute messages.
|
|
|
|
$review
|
|
|
|
(ta-think | src +.cod)
|
2017-04-28 20:40:12 +03:00
|
|
|
::> %burden commands ask us to add the sender as a
|
|
|
|
::> federator for the specified story, taking the
|
|
|
|
::> state it sent into account.
|
|
|
|
$burden
|
|
|
|
(ta-burden src +.cod)
|
|
|
|
::> %relief commands prompt us to relieve the
|
|
|
|
::> specified federators of their duty.
|
|
|
|
$relief
|
|
|
|
(ta-relieve src +.cod)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-28 20:40:12 +03:00
|
|
|
++ ta-burden ::< accept federator
|
|
|
|
::> adds {src} as a federator to story {nom},
|
|
|
|
::> integrating its state into the story.
|
|
|
|
::
|
|
|
|
|= {src/ship nom/knot cof/lobby pes/crowd gaz/(list telegram)}
|
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
|
|
|
(so-burden:sor src cof pes gaz)
|
|
|
|
::
|
|
|
|
++ ta-relieve ::< remove federator
|
|
|
|
::> removes {who} as federators from story {nom}.
|
|
|
|
::
|
|
|
|
|= {src/ship nom/knot who/(set ship)}
|
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
|
|
|
(so-relieve:sor src who)
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-action ::< apply reader action
|
|
|
|
::> performs action sent by a reader.
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
|
|
|
|= {red/bone act/action}
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
=< work
|
|
|
|
::> ||
|
|
|
|
::> || %actions
|
|
|
|
::> ||
|
|
|
|
::> action processing core
|
|
|
|
::>
|
|
|
|
::> ++work calls the appropriate action processing
|
|
|
|
::> arm. most use ++affect to retrieve the affected
|
|
|
|
::> story, reacting if it doesn't exist.
|
|
|
|
|%
|
|
|
|
:: || %utility
|
|
|
|
::+|
|
|
|
|
++ work ::< perform action
|
|
|
|
^+ ..ta-action
|
|
|
|
?- -.act
|
2017-04-24 21:17:56 +03:00
|
|
|
:: circle configuration
|
2017-04-21 00:59:36 +03:00
|
|
|
$create (action-create +.act)
|
|
|
|
$source (action-source +.act)
|
|
|
|
$depict (action-depict +.act)
|
|
|
|
$permit (action-permit +.act)
|
|
|
|
$delete (action-delete +.act)
|
2017-04-28 20:40:12 +03:00
|
|
|
$enlist (action-enlist +.act)
|
|
|
|
$burden (action-burden +.act)
|
2017-04-21 00:59:36 +03:00
|
|
|
:: messaging
|
|
|
|
$convey (action-convey +.act)
|
|
|
|
$phrase (action-phrase +.act)
|
|
|
|
:: personal metadata
|
|
|
|
$status (action-status +.act)
|
|
|
|
:: changing shared ui
|
|
|
|
$human (action-human +.act)
|
|
|
|
$glyph (action-glyph +.act)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ affect ::< affect story
|
|
|
|
::> produces a gill that takes a gate.
|
|
|
|
::> if the story {nom} exists, calls the gate with
|
|
|
|
::> a story core and the story itself.
|
|
|
|
::> if it doesn't, reacts accordingly.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= nom/knot
|
2017-04-24 21:17:56 +03:00
|
|
|
|= fec/$-({_so story} _ta)
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ta
|
|
|
|
=+ pur=(~(get by stories) nom)
|
|
|
|
?^ pur
|
|
|
|
(fec ~(. so nom ~ u.pur) u.pur)
|
|
|
|
%+ ta-react red
|
|
|
|
[%fail (crip "no story {(trip nom)}") `act]
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
::> || %circle-configuration
|
2017-04-21 00:59:36 +03:00
|
|
|
::+|
|
|
|
|
++ action-create ::< create story
|
|
|
|
::> creates a story with the specified parameters.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
|= {nom/knot des/cord typ/security}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
|
|
|
?. (~(has in stories) nom)
|
2017-04-28 20:40:12 +03:00
|
|
|
%+ ta-config nom
|
|
|
|
:* [[%& our.bol nom] ~ ~]
|
|
|
|
des
|
|
|
|
[typ ~]
|
|
|
|
[[our.bol ~ ~] [our.bol ~ ~]]
|
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-react red %fail (crip "{(trip nom)}: already exists") `act)
|
|
|
|
::
|
2017-05-03 19:38:41 +03:00
|
|
|
++ action-delete ::< delete + announce
|
|
|
|
::> delete story {nom}, optionally announcing the
|
|
|
|
::> event with message {mes}.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-05-03 19:38:41 +03:00
|
|
|
|= {nom/knot mes/(unit cord)}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
2017-05-03 19:38:41 +03:00
|
|
|
%- (affect nom) |= *
|
|
|
|
=. ..ta-action ::TODO =?
|
|
|
|
?~ mes ..ta-action
|
|
|
|
%+ action-phrase
|
|
|
|
[[%& our.bol nom] ~ ~]
|
|
|
|
[%lin | u.mes]~
|
|
|
|
(ta-unconfig nom)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ action-depict ::< change description
|
|
|
|
::> change description of story {nom} to {des}.
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {nom/knot des/cord}
|
|
|
|
^+ ..ta-action
|
|
|
|
%- (affect nom) |= {sor/_so soy/story}
|
2017-04-24 21:17:56 +03:00
|
|
|
=. cap.shape.soy des
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-config nom shape.soy)
|
|
|
|
::
|
|
|
|
++ action-permit ::< invite/banish
|
|
|
|
::> invite to/banish from story {nom} all {sis}.
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {nom/knot inv/? sis/(set ship)}
|
|
|
|
^+ ..ta-action
|
|
|
|
%- (affect nom) |= {sor/_so *} =< so-done
|
|
|
|
(so-permit:sor inv sis)
|
|
|
|
::
|
2017-05-03 19:38:41 +03:00
|
|
|
++ action-source ::< un/sub p to/from r
|
|
|
|
::> add/remove {pas} as sources for story {nom}.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-05-03 19:38:41 +03:00
|
|
|
|= {nom/knot sub/? pas/(set partner)}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
2017-05-03 19:38:41 +03:00
|
|
|
%- (affect nom) |= {sor/_so soy/story}
|
|
|
|
=. src.shape.soy
|
|
|
|
%. pas
|
|
|
|
?: sub
|
|
|
|
~(uni in src.shape.soy)
|
|
|
|
~(dif in src.shape.soy)
|
|
|
|
(ta-config nom shape.soy)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-04-28 20:40:12 +03:00
|
|
|
++ action-enlist ::< dis/allow federation
|
|
|
|
::> adds {sis} to story {nom}'s list of allowed
|
|
|
|
::> federators.
|
|
|
|
::
|
|
|
|
|= {nom/knot fed/? sis/(set ship)}
|
|
|
|
^+ ..ta-action
|
|
|
|
%- (affect nom) |= {sor/_so soy/story}
|
|
|
|
::TODO maybe so-enlist, with message note and everything
|
|
|
|
=. may.fed.shape.soy
|
|
|
|
%. sis
|
|
|
|
?: fed
|
|
|
|
~(uni in may.fed.shape.soy)
|
|
|
|
~(dif in may.fed.shape.soy)
|
|
|
|
(ta-config nom shape.soy)
|
|
|
|
::
|
|
|
|
++ action-burden ::< help federate
|
|
|
|
::> starts federating the specified circle. create
|
|
|
|
::> it locally if it doesn't yet exist.
|
|
|
|
::
|
|
|
|
|= {hos/ship nom/knot}
|
|
|
|
^+ ..ta-action
|
|
|
|
:: update federation config.
|
|
|
|
=+ soy=(fall (~(get by stories) nom) *story)
|
|
|
|
=. may.fed.shape.soy
|
|
|
|
(~(put in may.fed.shape.soy) hos)
|
|
|
|
=. fes.fed.shape.soy
|
|
|
|
(~(put in fes.fed.shape.soy) hos)
|
|
|
|
=. src.shape.soy
|
|
|
|
(~(put in src.shape.soy) [%& hos nom])
|
|
|
|
=. ..ta-action
|
|
|
|
(ta-config nom shape.soy)
|
|
|
|
:: send %burden command with story's current state.
|
|
|
|
%- ta-emit
|
|
|
|
:* ost.bol
|
|
|
|
%poke
|
|
|
|
/burden
|
|
|
|
[hos %talk-guardian]
|
|
|
|
:* %talk-command
|
|
|
|
%burden
|
|
|
|
nom
|
|
|
|
[shape.soy mirrors.soy]
|
|
|
|
[locals.soy remotes.soy]
|
|
|
|
grams.soy
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> || %messaging
|
|
|
|
::+|
|
|
|
|
++ action-convey ::< post exact
|
|
|
|
::> sends the messages provided in the action.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= tos/(list thought)
|
|
|
|
^+ ..ta-action
|
|
|
|
(ta-think & our.bol tos)
|
|
|
|
::
|
|
|
|
++ action-phrase ::< post easy
|
|
|
|
::> sends the message contents provided in the
|
|
|
|
::> action, constructing the audience, generating a
|
|
|
|
::> serial and setting a timestamp.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pas/(set partner) ses/(list speech)}
|
|
|
|
^+ ..ta-action
|
|
|
|
=- (ta-think & our.bol tos)
|
2017-04-14 00:40:53 +03:00
|
|
|
|- ^- tos/(list thought)
|
2017-04-21 00:59:36 +03:00
|
|
|
?~ ses ~
|
|
|
|
=^ sir eny.bol (uniq eny.bol)
|
|
|
|
:_ $(ses t.ses)
|
2017-04-14 00:40:53 +03:00
|
|
|
:+ sir
|
|
|
|
%- ~(gas by *audience)
|
2017-04-21 00:59:36 +03:00
|
|
|
%+ turn (~(tap in pas))
|
2017-04-14 00:40:53 +03:00
|
|
|
|=(p/partner [p *envelope %pending])
|
2017-04-21 00:59:36 +03:00
|
|
|
[now.bol ~ i.ses]
|
|
|
|
::
|
|
|
|
::> || %personal-metadata
|
|
|
|
::+|
|
|
|
|
++ action-status ::< our status update
|
|
|
|
::> for every story in the set, update our status.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {nos/(set knot) sat/status}
|
|
|
|
^+ ..ta-action
|
|
|
|
%- ~(rep in nos)
|
|
|
|
|= {k/knot _ta}
|
|
|
|
%- (affect k) |= {sor/_so *}
|
|
|
|
so-done:(so-notify:sor our.bol sat)
|
|
|
|
::
|
|
|
|
::> || %changing-shared-ui
|
|
|
|
::+|
|
|
|
|
++ action-human ::< new identity
|
|
|
|
::> assigns a new local identity ("nickname") to the
|
|
|
|
::> target ship.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {sip/ship nic/human}
|
|
|
|
^+ ..ta-action
|
|
|
|
?. =((~(get by folks) sip) `nic) ..ta-action ::< no change
|
2017-03-25 02:24:55 +03:00
|
|
|
=. folks
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ han.nic (~(del by folks) sip)
|
2017-04-21 00:59:36 +03:00
|
|
|
(~(put by folks) sip nic)
|
|
|
|
%+ ta-inform %names
|
2017-03-27 13:50:39 +03:00
|
|
|
::TODO think long and hard, do we need unit for delition or is a human
|
|
|
|
:: with [~ ~] good enough? if the latter, agent's $names will change.
|
2017-04-24 21:17:56 +03:00
|
|
|
(strap sip ?~(han.nic ~ `nic))
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ action-glyph ::< bind a glyph
|
|
|
|
::> un/bind glyph {lif} to partners {pas}.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {lif/char pas/(set partner) bin/?}
|
|
|
|
=. ..ta-action
|
|
|
|
?: bin
|
|
|
|
%= ..ta-action ::< bind
|
|
|
|
nik (~(put by nik) pas lif)
|
|
|
|
nak (~(put ju nak) lif pas)
|
2017-04-18 15:29:17 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ ole/(set (set partner)) ::< unbind
|
|
|
|
?. =(pas ~) [pas ~ ~]
|
|
|
|
(~(get ju nak) lif)
|
|
|
|
|- ^+ ..ta-action
|
|
|
|
?~ ole ..ta-action
|
|
|
|
=. ..ta-action $(ole l.ole)
|
|
|
|
=. ..ta-action $(ole r.ole)
|
|
|
|
%= ..ta-action
|
|
|
|
nik (~(del by nik) pas)
|
|
|
|
nak (~(del ju nak) lif pas)
|
2017-04-18 15:29:17 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-inform %glyph nak)
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ ta-diff-report ::< subscription update
|
2017-04-25 22:18:14 +03:00
|
|
|
::> process a talk report from {cir} into story {nom}.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {nom/knot cir/circle ret/report}
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
2017-04-25 22:18:14 +03:00
|
|
|
(so-diff-report:sor cir ret)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %subscription-events
|
|
|
|
::> ||
|
|
|
|
::> arms that react to subscription events.
|
|
|
|
::+|
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-subscribe ::< listen to
|
|
|
|
::> start {her} susbcription on {pax}.
|
|
|
|
::> for readers, we forward to ++ta-welcome.
|
|
|
|
::> for foreign brokers, we check if their desired
|
|
|
|
::> story exists and if they have permission to
|
|
|
|
::> subscribe to it, before sending them all data.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {her/ship pax/path}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
:: reader subscription.
|
|
|
|
?: ?=({$reader *} pax)
|
|
|
|
?. (team our.bol her)
|
2017-04-25 14:33:02 +03:00
|
|
|
%- ta-note
|
|
|
|
(crip "foreign reader {(scow %p her)}")
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-welcome ost.bol t.pax)
|
|
|
|
:: weird subscription path.
|
|
|
|
?. ?=({@ *} pax)
|
|
|
|
(ta-evil %bad-path)
|
|
|
|
=+ pur=(~(get by stories) i.pax)
|
|
|
|
?~ pur
|
2017-04-25 22:09:20 +03:00
|
|
|
::TODO send this to the subscriber! make them unsub!
|
2017-04-25 14:33:02 +03:00
|
|
|
%- ta-note
|
|
|
|
(crip "bad subscribe story '{(trip i.pax)}'")
|
2017-04-21 00:59:36 +03:00
|
|
|
=+ soy=~(. so i.pax `(list action)`~ u.pur) :: nest-fail if no cast
|
|
|
|
:: she needs read permissions to subscribe.
|
|
|
|
?. (so-visible:soy her)
|
|
|
|
(ta-evil %no-story)
|
|
|
|
::TODO? or (so-sauce ost.bol [%quit ~]~) ?
|
|
|
|
=^ who +>.$ (ta-human her)
|
|
|
|
:: send current data to bring her up to date.
|
2017-04-27 00:33:25 +03:00
|
|
|
=. soy (so-report-lobby:soy ost.bol ~ ~)
|
2017-05-03 19:39:23 +03:00
|
|
|
=. soy (so-report-crowd:soy ost.bol ~ ~)
|
2017-04-25 22:09:20 +03:00
|
|
|
=. soy (so-start:soy her t.pax) ::< also adds story sub
|
2017-04-21 00:59:36 +03:00
|
|
|
=. soy (so-notify:soy her %hear who) ::< add her status
|
|
|
|
so-done:soy ::< apply story changes
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-welcome ::< reader subscription
|
|
|
|
::> brings new reader up to date. susbcribes it to the specified story,
|
|
|
|
::TODO or shared ui state if no story was specified.
|
|
|
|
::TODO maybe also send a list of knots again? (basically a %house lowdown)
|
|
|
|
::
|
|
|
|
|= {new/bone pax/path}
|
|
|
|
=/ sor/knot
|
|
|
|
?: ?=({@tas *} pax) i.pax
|
|
|
|
(main our.bol) :: default to mailbox
|
|
|
|
::> new reader? send shared ui state.
|
|
|
|
=. +>.$ ::TODO =?
|
|
|
|
?: (~(has by readers) new) +>.$
|
|
|
|
%- ta-emil
|
2017-04-21 17:14:11 +03:00
|
|
|
:~ ::> bound glyphs
|
2017-04-21 00:59:36 +03:00
|
|
|
[new %diff %talk-lowdown %glyph nak]
|
2017-04-21 17:14:11 +03:00
|
|
|
::> nicknames
|
2017-04-21 00:59:36 +03:00
|
|
|
[new %diff %talk-lowdown %names (~(run by folks) some)]
|
|
|
|
==
|
|
|
|
::> send story state.
|
|
|
|
=. +>.$ ::TODO =?
|
|
|
|
?. (~(has by stories) sor) +>.$
|
|
|
|
=+ soy=(~(got by stories) sor)
|
|
|
|
%- ta-emil
|
2017-04-21 17:14:11 +03:00
|
|
|
:~ ::> configurations
|
2017-04-21 00:59:36 +03:00
|
|
|
:* new %diff %talk-lowdown %confs
|
|
|
|
`shape.soy (~(run by mirrors.soy) some)
|
|
|
|
==
|
2017-04-21 17:14:11 +03:00
|
|
|
::> presences
|
2017-04-21 00:59:36 +03:00
|
|
|
[new %diff %talk-lowdown %precs locals.soy remotes.soy]
|
2017-04-21 17:14:11 +03:00
|
|
|
::> messages
|
2017-04-21 00:59:36 +03:00
|
|
|
[new %diff %talk-lowdown %grams 0 grams.soy]
|
|
|
|
==
|
|
|
|
::> add this subscription to {readers}.
|
|
|
|
%= +>.$
|
|
|
|
readers
|
|
|
|
%+ ~(put by readers) new
|
|
|
|
(~(put in (fall (~(get by readers) new) ~)) sor)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta-retry ::< subscription resend
|
2017-04-25 22:18:14 +03:00
|
|
|
::> re-subscribes {cir} to story {nom}.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {nom/knot cir/circle}
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
2017-04-25 22:18:14 +03:00
|
|
|
(so-acquire:sor [%& cir]~)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ ta-quit ::< subscription failed
|
2017-04-25 22:18:14 +03:00
|
|
|
::> removes {cir} from story {nom}'s followers.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {nom/knot cir/circle}
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
2017-04-25 22:18:14 +03:00
|
|
|
(so-quit:sor %& cir)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ ta-cancel ::< unsubscribe
|
|
|
|
::> drops {src}'s subscription. deduce the right way
|
|
|
|
::> to do this from the subscription path {pax}.
|
|
|
|
::
|
|
|
|
|= {src/ship pax/path}
|
2017-04-04 17:15:12 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
:: remove a reader subscription.
|
|
|
|
?: ?=({$reader *} pax)
|
|
|
|
=/ nom/knot
|
|
|
|
?: ?=({@tas *} t.pax) i.pax
|
|
|
|
(main our.bol) ::TODO change when ++ta-welcome changes.
|
|
|
|
=/ nes/(set knot)
|
|
|
|
%. nom
|
|
|
|
~(del in (~(got by readers) ost.bol))
|
|
|
|
+>.$(readers (~(put by readers) ost.bol nes))
|
|
|
|
:: weird subscription path.
|
|
|
|
?. ?=({@ @ *} pax)
|
2017-04-25 14:33:02 +03:00
|
|
|
%- ta-note
|
|
|
|
(crip "ta-cancel weird path {~(ram re >pax<)}")
|
2017-04-21 00:59:36 +03:00
|
|
|
:: remove a regular subscription, set ship status to %gone.
|
|
|
|
%- (ta-know i.pax) |= sor/_so =< so-done
|
|
|
|
(so-notify:so-cancel:sor src %gone *human)
|
2017-04-04 17:15:12 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> || %fora
|
|
|
|
::> fora things.
|
|
|
|
::TODO move outside of guardian...
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-base-hart
|
2017-03-23 03:34:56 +03:00
|
|
|
::x produces our ship's host desk's web address as a hart.
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
.^(hart %e /(scot %p our.bol)/host/(scot %da now.bol))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-fora-post
|
2017-03-23 03:34:56 +03:00
|
|
|
::x sends a fora post. if we don't have a channel for posts yet, create one
|
|
|
|
::
|
|
|
|
|= {pax/path sup/spur hed/@t txt/@t}
|
|
|
|
::x tell %hood to submit a fora post.
|
2017-04-21 00:59:36 +03:00
|
|
|
=. ..ta-emit
|
|
|
|
%+ ta-emit ost.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
:* %poke
|
|
|
|
/fora-post
|
2017-04-21 00:59:36 +03:00
|
|
|
[our.bol %hood]
|
|
|
|
[%write-fora-post sup src.bol hed txt]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
=+ man=%posts
|
|
|
|
::x if we have a %posts story, go ahead and consume.
|
|
|
|
?: (~(has by stories) man)
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-consume-fora-post man pax hed txt)
|
2017-03-23 03:34:56 +03:00
|
|
|
::x if we have no %posts story, first create it, then consume.
|
2017-04-21 00:59:36 +03:00
|
|
|
=; new (ta-consume-fora-post:new man pax hed txt)
|
|
|
|
=. ..ta-action
|
|
|
|
%+ ta-action ost.bol
|
2017-04-14 01:46:15 +03:00
|
|
|
[%create man 'towards a community' %brown]
|
2017-03-23 03:34:56 +03:00
|
|
|
::x send informative message to our mailbox.
|
2017-04-21 00:59:36 +03:00
|
|
|
%^ ta-consume & our.bol
|
|
|
|
:^ (shaf %init eny.bol) ::< serial
|
|
|
|
(my [[%& our.bol (main our.bol)] *envelope %pending] ~) ::< audience
|
|
|
|
::> statement
|
|
|
|
now.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
[~ %app %tree 'receiving forum posts, ;join %posts for details']
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-consume-fora-post
|
2017-03-23 03:34:56 +03:00
|
|
|
::x add a message for a fora post to the man story.
|
|
|
|
::
|
|
|
|
|= {man/knot pax/path hed/@t txt/@t} ^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
=. pax (welp pax /posts/(crip "{<now.bol>}~"))
|
|
|
|
%^ ta-consume |
|
|
|
|
src.bol
|
|
|
|
:* (shaf %comt eny.bol)
|
|
|
|
(my [[%& our.bol man] *envelope %pending] ~)
|
|
|
|
now.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
(sy /fora-post eyre+pax ~)
|
|
|
|
:- %mor :~
|
2017-04-21 00:59:36 +03:00
|
|
|
[%fat text+(lore txt) [%url [ta-base-hart `pax ~] ~]]
|
2017-03-23 03:34:56 +03:00
|
|
|
[%app %tree (crip "forum post: '{(trip hed)}'")]
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-comment
|
2017-03-23 03:34:56 +03:00
|
|
|
::x sends a comment. if we don't have a channel for them yet, creates one.
|
|
|
|
::
|
|
|
|
|= {pax/path sup/spur txt/@t}
|
2017-04-21 00:59:36 +03:00
|
|
|
=. ..ta-emit
|
|
|
|
%+ ta-emit ost.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
:* %poke
|
|
|
|
/comment
|
2017-04-21 00:59:36 +03:00
|
|
|
[our.bol %hood]
|
|
|
|
[%write-comment sup src.bol txt]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
=+ man=%comments
|
|
|
|
?: (~(has by stories) man)
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-consume-comment man pax sup txt)
|
|
|
|
=; new (ta-consume-comment:new man pax sup txt)
|
|
|
|
=. ..ta-action
|
|
|
|
%+ ta-action ost.bol
|
2017-04-14 01:46:15 +03:00
|
|
|
[%create man 'letters to the editor' %brown]
|
2017-04-21 00:59:36 +03:00
|
|
|
%^ ta-consume & our.bol
|
|
|
|
:^ (shaf %init eny.bol)
|
|
|
|
(my [[%& our.bol (main our.bol)] *envelope %pending] ~)
|
|
|
|
now.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
[~ %app %tree 'receiving comments, ;join %comments for details']
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-consume-comment
|
2017-03-23 03:34:56 +03:00
|
|
|
::x adds a message for a comment to the man story.
|
|
|
|
::
|
|
|
|
|= {man/knot pax/path sup/spur txt/@t} ^+ +>
|
|
|
|
=+ nam=?~(sup "" (trip i.sup)) :: file name
|
2017-04-21 00:59:36 +03:00
|
|
|
=+ fra=(crip (time-to-id now.bol)) :: url fragment
|
|
|
|
%^ ta-consume |
|
|
|
|
src.bol
|
|
|
|
:* (shaf %comt eny.bol)
|
|
|
|
(my [[%& our.bol man] *envelope %pending] ~)
|
|
|
|
now.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
(sy /comment eyre+pax ~)
|
|
|
|
:- %mor :~
|
2017-04-21 00:59:36 +03:00
|
|
|
[%fat text+(lore txt) [%url [ta-base-hart `pax ~] `fra]]
|
2017-03-23 03:34:56 +03:00
|
|
|
[%app %tree (crip "comment on /{nam}")]
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %messaging
|
|
|
|
::> ||
|
|
|
|
::> arms for sending and processing messages.
|
|
|
|
::+|
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-think ::< publish or review
|
|
|
|
::> consumes each thought.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pub/? aut/ship tos/(list thought)}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
?~ tos +>
|
|
|
|
$(tos t.tos, +> (ta-consume pub aut i.tos))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-sane ::< sanitize
|
|
|
|
::> sanitize %lin speech, enforce lowercase and no special characters.
|
2017-04-24 21:17:56 +03:00
|
|
|
::TODO make configurable per-circle.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= tot/thought
|
2017-03-23 03:34:56 +03:00
|
|
|
^- thought
|
2017-04-24 21:17:56 +03:00
|
|
|
?. ?=({$lin *} sep.sam.tot) tot
|
|
|
|
%_ tot
|
|
|
|
msg.sep.sam
|
2017-03-23 03:34:56 +03:00
|
|
|
%- crip
|
|
|
|
%+ scag 64
|
|
|
|
%- tufa
|
2017-04-24 21:17:56 +03:00
|
|
|
%+ turn (tuba (trip msg.sep.sam.tot))
|
2017-03-23 03:34:56 +03:00
|
|
|
|= a/@c
|
|
|
|
?: &((gte a 'A') (lte a 'Z'))
|
|
|
|
(add a 32)
|
|
|
|
?: |((lth a 32) (gth a 126))
|
|
|
|
`@`'?'
|
|
|
|
a
|
|
|
|
==
|
|
|
|
::
|
2017-04-21 17:14:11 +03:00
|
|
|
++ ta-consume ::< to each audience
|
2017-04-21 00:59:36 +03:00
|
|
|
::> conducts thought {tot} to each partner in its audience.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pub/? aut/ship tot/thought}
|
|
|
|
=. tot (ta-sane tot)
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ aud=(~(tap by aud.tot))
|
2017-03-23 03:34:56 +03:00
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ aud +>.^$
|
2017-04-21 00:59:36 +03:00
|
|
|
$(aud t.aud, +>.^$ (ta-conduct pub aut p.i.aud tot))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 17:14:11 +03:00
|
|
|
++ ta-conduct ::< thought to partner
|
2017-04-21 00:59:36 +03:00
|
|
|
::> either publishes or records a thought.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pub/? aut/ship pan/partner tot/thought}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
?- -.pan
|
2017-04-24 21:17:56 +03:00
|
|
|
$& ::< circle partner
|
2017-04-21 00:59:36 +03:00
|
|
|
?: pub
|
|
|
|
?. (team our.bol aut)
|
2017-04-25 14:33:02 +03:00
|
|
|
%- ta-note
|
|
|
|
(crip "strange author {(scow %p aut)}")
|
2017-04-21 00:59:36 +03:00
|
|
|
=. aut our.bol
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(aut hos.p.pan)
|
|
|
|
(ta-record nom.p.pan hos.p.pan tot)
|
2017-04-21 00:59:36 +03:00
|
|
|
(ta-transmit p.pan tot)
|
2017-04-24 21:17:56 +03:00
|
|
|
?. =(our.bol hos.p.pan) +>
|
|
|
|
(ta-record nom.p.pan aut tot)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
$| !! ::< passport partner
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-record ::< add to story
|
|
|
|
::> add or update telegram {gam} in story {nom}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {nom/knot gam/telegram}
|
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
|
|
|
(so-learn:sor gam)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-transmit ::< send message
|
2017-04-25 22:18:14 +03:00
|
|
|
::> sends thought {tot} to {cir}.
|
2017-04-21 00:59:36 +03:00
|
|
|
::> stores it to the outbox to await confirmation.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {cir/circle tot/thought}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
|
|
|
=. +>
|
2017-04-21 00:59:36 +03:00
|
|
|
%+ ta-emit ost.bol
|
2017-03-23 03:34:56 +03:00
|
|
|
:* %poke
|
2017-04-25 22:18:14 +03:00
|
|
|
/repeat/(scot %ud p.outbox)/(scot %p hos.cir)/[nom.cir]
|
|
|
|
[hos.cir %talk-guardian]
|
2017-04-21 00:59:36 +03:00
|
|
|
[%talk-command [%review tot ~]]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
+>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tot))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-coup-repeat ::< remove from outbox
|
|
|
|
::> assemble partner and call ++ta-repeat.
|
|
|
|
::
|
|
|
|
|= {{num/@ud src/ship nom/knot} fal/(unit tang)}
|
|
|
|
(ta-repeat num [%& src nom] fal)
|
|
|
|
::
|
|
|
|
++ ta-repeat ::< remove from outbox
|
|
|
|
::> take message out of outbox, mark it as received
|
|
|
|
::> or rejected, based on the existence of error
|
|
|
|
::> message {fal}.
|
|
|
|
::
|
|
|
|
|= {num/@ud pan/partner fal/(unit tang)}
|
|
|
|
=+ oot=(~(get by q.outbox) num)
|
|
|
|
?~ oot ~|([%ta-repeat-none num] !!)
|
|
|
|
=. q.outbox (~(del by q.outbox) num)
|
2017-04-24 21:17:56 +03:00
|
|
|
=. aud.u.oot
|
|
|
|
=+ olg=(~(got by aud.u.oot) pan)
|
|
|
|
%+ ~(put by aud.u.oot) pan
|
2017-04-21 00:59:36 +03:00
|
|
|
:- -.olg
|
|
|
|
?~ fal %received
|
|
|
|
~> %slog.[0 u.fal]
|
|
|
|
%rejected
|
|
|
|
(ta-think | our.bol u.oot ~)
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %stories
|
|
|
|
::> ||
|
|
|
|
::> arms for modifying stories.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-config ::< configure story
|
|
|
|
::> configures story {nom}, creating it if needed.
|
|
|
|
::> if it's a whitelist config, and we're creating
|
|
|
|
::> the story, makes sure we're in it.
|
|
|
|
::
|
|
|
|
|= {nom/knot con/config}
|
|
|
|
^+ +>
|
|
|
|
::> neu: is new story
|
|
|
|
::> pur: the story
|
|
|
|
::> wyt: will be white
|
|
|
|
=+ :+ neu=!(~(has by stories) nom)
|
|
|
|
pur=(fall (~(get by stories) nom) *story)
|
2017-04-24 21:17:56 +03:00
|
|
|
wyt=?=(?($white $green) sec.con.con)
|
|
|
|
=. ses.con.con ::TODO =?
|
2017-04-21 00:59:36 +03:00
|
|
|
?: &(neu wyt) [our.bol ~ ~]
|
2017-04-24 21:17:56 +03:00
|
|
|
ses.con.con
|
2017-04-21 00:59:36 +03:00
|
|
|
so-done:(~(so-reform so nom ~ pur) con)
|
|
|
|
::
|
|
|
|
++ ta-unconfig ::< delete story
|
|
|
|
::> calls the story core to delete story {nom}.
|
|
|
|
::
|
|
|
|
|= nom/knot
|
|
|
|
^+ +>
|
2017-04-21 17:14:11 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
|
|
|
so-reform-gone:so
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so ::< story core
|
|
|
|
::> story core, used for doing work on a story.
|
|
|
|
::
|
|
|
|
|_ ::> nom: story name in {stories}.
|
|
|
|
::> acs: talk actions issued due to changes.
|
|
|
|
::> story is faceless to ease data access.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
$: nom/knot
|
2017-04-14 01:46:15 +03:00
|
|
|
acs/(list action)
|
2017-03-23 03:34:56 +03:00
|
|
|
story
|
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so-done ::< apply changes
|
|
|
|
::> put changed story back into the map and apply
|
|
|
|
::> actions.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
=. +> +>(stories (~(put by stories) nom +<+>))
|
2017-04-14 01:46:15 +03:00
|
|
|
=. acs (flop acs)
|
2017-04-10 23:35:25 +03:00
|
|
|
|- ^+ +>+
|
2017-04-14 01:46:15 +03:00
|
|
|
?~ acs +>+
|
2017-04-21 00:59:36 +03:00
|
|
|
=. +>+ (ta-action ost.bol i.acs)
|
2017-04-14 01:46:15 +03:00
|
|
|
$(acs t.acs)
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-sauce ::< send backward
|
|
|
|
::> cards to moves, prepend to {moves} reversed.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {ost/bone cub/(list card)}
|
|
|
|
%_ +>.$
|
|
|
|
moves
|
|
|
|
(welp (flop (turn cub |=(a/card [ost a]))) moves)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-act ::< send action
|
|
|
|
::> stores a talk action.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= act/action
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
+>(acs [act acs])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-25 14:33:02 +03:00
|
|
|
++ so-note ::< tell user
|
|
|
|
::> sends {msg} as an %app message to the user's
|
|
|
|
::> inbox.
|
|
|
|
::
|
|
|
|
|= msg/cord
|
|
|
|
^+ +>
|
|
|
|
%+ so-act %phrase
|
|
|
|
:- [[%& our.bol (main our.bol)] ~ ~]
|
|
|
|
[%app %talk-guardian msg]~
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-inform ::< send lowdown
|
|
|
|
::> sends lowdown to all interested readers.
|
2017-03-29 18:03:59 +03:00
|
|
|
::
|
|
|
|
|= low/lowdown
|
|
|
|
=. moves
|
2017-04-12 14:14:09 +03:00
|
|
|
%+ weld
|
|
|
|
^- (list move)
|
2017-04-21 00:59:36 +03:00
|
|
|
%+ murn (~(tap by readers))
|
2017-04-12 14:14:09 +03:00
|
|
|
|= {b/bone s/(set knot)}
|
|
|
|
^- (unit move)
|
2017-04-21 00:59:36 +03:00
|
|
|
?. (~(has in s) nom) ~
|
2017-04-12 14:14:09 +03:00
|
|
|
`[b %diff %talk-lowdown low]
|
|
|
|
moves
|
2017-03-29 18:03:59 +03:00
|
|
|
+>.$
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-report ::< send update
|
|
|
|
::> sends report to all bones.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {bos/(set bone) ret/report}
|
|
|
|
^+ +>
|
|
|
|
?~ bos +>
|
|
|
|
=. +> $(bos l.bos)
|
|
|
|
=. +> $(bos r.bos)
|
|
|
|
(so-sauce n.bos [%diff %talk-report ret]~)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-05-03 19:39:23 +03:00
|
|
|
++ so-report-crowd ::< presence update
|
2017-04-21 00:59:36 +03:00
|
|
|
::> send local and remote presences in a report.
|
2017-04-03 17:50:35 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= bos/(set bone)
|
2017-04-27 00:33:25 +03:00
|
|
|
(so-report bos %crowd locals so-remotes)
|
2017-04-03 17:50:35 +03:00
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
++ so-report-lobby ::< config update
|
2017-04-21 00:59:36 +03:00
|
|
|
::> send local and remote configs in a report.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= bos/(set bone)
|
2017-04-27 00:33:25 +03:00
|
|
|
(so-report bos %lobby shape mirrors)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %data
|
|
|
|
::> ||
|
|
|
|
::> utility functions for data retrieval.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-followers ::< follower bones
|
|
|
|
::> turns the keys of {followers} into a set.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
^- (set bone)
|
|
|
|
%- ~(gas in *(set bone))
|
|
|
|
%+ turn (~(tap by followers))
|
|
|
|
|= {b/bone *} b
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-unearth ::< ships' bones
|
|
|
|
::> find the bones in {followers} that belong to
|
|
|
|
::> a ship in {sis}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= sis/(set ship)
|
|
|
|
^- (set bone)
|
|
|
|
%- ~(rep in sup.bol)
|
|
|
|
|= {{b/bone s/ship p/path} c/(set bone)}
|
|
|
|
?. ?& (~(has in sis) s)
|
|
|
|
(~(has by followers) b)
|
|
|
|
?=({@tas *} p)
|
|
|
|
=(i.p nom)
|
|
|
|
==
|
|
|
|
c
|
|
|
|
(~(put in c) b)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-remotes ::< remote presences
|
|
|
|
::> produces {remotes}, with all our local
|
|
|
|
::> presences replaced by the versions from their
|
|
|
|
::> stories.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
%- ~(urn by remotes) :: XX performance
|
2017-04-27 00:33:25 +03:00
|
|
|
|= {pan/partner gop/group}
|
|
|
|
^- group
|
|
|
|
?. &(?=($& -.pan) =(our.bol hos.p.pan)) gop
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ soy=(~(get by stories) nom.p.pan)
|
2017-04-27 00:33:25 +03:00
|
|
|
?~ soy gop
|
2017-04-21 00:59:36 +03:00
|
|
|
locals.u.soy
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-28 20:40:12 +03:00
|
|
|
++ so-right ::< is federator?
|
|
|
|
::> checks whether partner {pan} has authority
|
|
|
|
::> over this story.
|
|
|
|
::
|
|
|
|
|= pan/partner
|
|
|
|
?& ?=($& -.pan)
|
|
|
|
=(nom nom.p.pan)
|
|
|
|
(~(has in fes.fed.shape) hos.p.pan)
|
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %interaction-events
|
|
|
|
::> ||
|
|
|
|
::> arms that apply events we received.
|
|
|
|
::+|
|
|
|
|
::
|
2017-04-28 20:40:12 +03:00
|
|
|
++ so-burden ::< accept federator
|
|
|
|
::> if {src} is allowed to, have it federate this
|
|
|
|
::> story.
|
|
|
|
::> starts by assimilating {src}'s state into our
|
|
|
|
::> own (giving priority to local state), removing
|
|
|
|
::> redundant data, then sending updated state to
|
|
|
|
::> all followers.
|
|
|
|
::
|
|
|
|
|= {src/ship cof/lobby pes/crowd gaz/(list telegram)}
|
|
|
|
^+ +>
|
|
|
|
:: continue if permitted and not yet done.
|
|
|
|
?. (~(has in may.fed.shape) src) +>
|
|
|
|
?: (~(has in fes.fed.shape) src) +>
|
|
|
|
:: assimilate config.
|
|
|
|
=. +>
|
|
|
|
=+ nec=shape
|
|
|
|
:: adopt security list if they're similar.
|
|
|
|
=. ses.con.nec ::TODO =?
|
|
|
|
?. .= ?=(?($white $green) sec.con.nec)
|
|
|
|
?=(?($white $green) sec.con.loc.cof)
|
|
|
|
ses.con.nec
|
|
|
|
(~(uni in ses.con.nec) ses.con.loc.cof)
|
|
|
|
=. fes.fed.nec
|
|
|
|
(~(put in fes.fed.nec) src)
|
|
|
|
=. src.nec
|
|
|
|
(~(put in src.nec) [%& src nom])
|
|
|
|
(so-reform nec)
|
|
|
|
:: assimilate presence and remotes.
|
|
|
|
=. locals (~(uni by loc.pes) locals)
|
|
|
|
=. remotes (~(uni by rem.pes) remotes)
|
|
|
|
=. mirrors (~(uni by rem.cof) mirrors)
|
|
|
|
:: remove redundant remotes.
|
|
|
|
=. remotes
|
|
|
|
%- ~(gas by *_remotes)
|
|
|
|
%+ murn (~(tap by remotes))
|
|
|
|
|= {p/partner g/group}
|
|
|
|
^- (unit {partner group})
|
|
|
|
?: ?& ?=($& -.p)
|
|
|
|
=(nom.p.p nom)
|
|
|
|
(~(has in fes.fed.shape) hos.p.p)
|
|
|
|
==
|
|
|
|
~
|
|
|
|
`[p g]
|
|
|
|
:: remove redundant mirrors.
|
|
|
|
=. mirrors
|
|
|
|
%- ~(gas by *_mirrors)
|
|
|
|
%+ murn (~(tap by mirrors))
|
|
|
|
|= {c/circle f/config}
|
|
|
|
^- (unit {circle config})
|
|
|
|
?: ?& =(nom.c nom)
|
|
|
|
(~(has in fes.fed.shape) hos.c)
|
|
|
|
==
|
|
|
|
~
|
|
|
|
`[c f]
|
|
|
|
:: send updates to followers.
|
2017-05-03 19:39:23 +03:00
|
|
|
=. +>.$ (so-report-crowd so-followers)
|
2017-04-28 20:40:12 +03:00
|
|
|
=. +>.$ (so-report-lobby so-followers)
|
|
|
|
:: finally, learn all grams.
|
|
|
|
(so-lesson gaz)
|
|
|
|
::
|
|
|
|
++ so-relieve ::< remove federator
|
|
|
|
::> if {src} is allowed to, removes {who} as
|
|
|
|
::> federators from this story.
|
|
|
|
::
|
|
|
|
|= {src/ship who/(set ship)}
|
|
|
|
^+ +>
|
|
|
|
?. (~(has in fes.fed.shape) src) +>
|
|
|
|
=+ nes=shape
|
|
|
|
=. fes.fed.nes
|
|
|
|
(~(dif in fes.fed.nes) who)
|
|
|
|
=. src.nes
|
|
|
|
%- ~(dif in src.nes)
|
|
|
|
^- (set partner)
|
|
|
|
%- ~(run in who)
|
|
|
|
|=(s/ship [%& s nom])
|
|
|
|
?: =(nes shape) +>.$
|
|
|
|
::TODO propogate %relief to other federators.
|
|
|
|
(so-reform nes)
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-diff-report ::< process update
|
2017-04-25 22:18:14 +03:00
|
|
|
::> process a talk report from {cir}.
|
2017-04-21 00:59:36 +03:00
|
|
|
::> if we didn't expect it, ignore.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {cir/circle ret/report}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ +>
|
2017-04-28 20:40:12 +03:00
|
|
|
?: =(cir [our.bol nom]) +>
|
2017-04-25 22:18:14 +03:00
|
|
|
?. (~(has in src.shape) [%& cir])
|
2017-04-25 14:33:02 +03:00
|
|
|
%- so-note
|
|
|
|
%- crip ;: weld
|
|
|
|
"so-diff unexpected "
|
2017-04-25 22:18:14 +03:00
|
|
|
(scow %p hos.cir) "/" (trip nom.cir)
|
2017-04-25 14:33:02 +03:00
|
|
|
" %" (scow %tas -.ret)
|
2017-04-28 20:40:12 +03:00
|
|
|
" in " (scow %tas nom)
|
2017-04-25 14:33:02 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
?- -.ret
|
2017-04-27 00:33:25 +03:00
|
|
|
$lobby (so-lobby cir +.ret)
|
|
|
|
$crowd (so-remind [%& cir] +.ret)
|
2017-04-24 21:17:56 +03:00
|
|
|
$grams (so-lesson gaz.ret)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
++ so-lobby ::< update config
|
2017-04-24 21:17:56 +03:00
|
|
|
::> add circle's config to our remote config map.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
::TODO when do we care about rem?
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {cir/circle con/config rem/(map circle config)}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ +>
|
2017-04-28 20:40:12 +03:00
|
|
|
:: if they're a federator, set new shape.
|
|
|
|
=. +> ::TODO =?
|
|
|
|
?. ?& =(nom nom.cir)
|
|
|
|
(~(has in fes.fed.shape) hos.cir)
|
|
|
|
==
|
|
|
|
+>
|
|
|
|
:: to prevent removal of federators during initial setup, only allow
|
|
|
|
:: federator deletion through explicit action.
|
|
|
|
=. fes.fed.con (~(uni in fes.fed.con) fes.fed.shape)
|
|
|
|
=. may.fed.con (~(uni in may.fed.con) may.fed.shape)
|
|
|
|
=. src.con ::TODO is this needed?
|
|
|
|
%- ~(uni in src.con)
|
|
|
|
^- (set partner)
|
|
|
|
%- ~(run in fes.fed.con)
|
|
|
|
|= s/ship
|
|
|
|
^- partner
|
|
|
|
[%& s nom]
|
|
|
|
(so-reform con)
|
2017-04-21 00:59:36 +03:00
|
|
|
=+ old=mirrors
|
2017-04-25 22:18:14 +03:00
|
|
|
=. mirrors (~(put by mirrors) cir con)
|
2017-04-21 00:59:36 +03:00
|
|
|
?: =(mirrors old) +>.$
|
2017-04-25 22:18:14 +03:00
|
|
|
=. +>.$ (so-inform %confs `shape (strap cir `con))
|
2017-04-27 00:33:25 +03:00
|
|
|
(so-report-lobby so-followers)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-remind ::< remote presence
|
2017-04-27 00:33:25 +03:00
|
|
|
::> adds {tay}'s {loc} to our remote presence map,
|
|
|
|
::> after merging with {rem}.
|
2017-04-21 00:59:36 +03:00
|
|
|
::> if this changes anything, send a report.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
|= {pan/partner loc/group rem/(map partner group)}
|
2017-04-28 20:40:12 +03:00
|
|
|
:: if they're a federator, set new locals.
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ buk (~(uni by remotes) rem)
|
|
|
|
=. buk (~(put by buk) pan loc)
|
2017-04-28 20:40:12 +03:00
|
|
|
:: seperate federation presences and true remotes.
|
|
|
|
=/ nep/crowd
|
|
|
|
%+ roll (~(tap by buk))
|
|
|
|
|= {{p/partner g/group} c/crowd}
|
|
|
|
?: (so-right p)
|
|
|
|
[(~(uni by loc.c) g) rem.c]
|
|
|
|
[loc.c (~(put by rem.c) p g)]
|
|
|
|
:: ensure we have the latest.
|
|
|
|
=. loc.nep
|
|
|
|
?. (so-right pan) (~(uni by locals) loc.nep)
|
|
|
|
(~(uni by (~(uni by locals) loc.nep)) loc)
|
|
|
|
:: if nothing changed, we're done.
|
|
|
|
?: ?& =(loc.nep locals)
|
|
|
|
=(rem.nep remotes)
|
|
|
|
==
|
|
|
|
+>.$
|
|
|
|
:: reader update.
|
|
|
|
=. +>.$ ::TODO =?
|
|
|
|
%^ so-inform %precs
|
|
|
|
(~(dif in loc.nep) locals) :: locals
|
|
|
|
:: per-partner diff for remotes.
|
|
|
|
%- ~(urn by rem.nep)
|
2017-04-27 00:33:25 +03:00
|
|
|
|= {p/partner a/group}
|
2017-04-21 00:59:36 +03:00
|
|
|
=+ o=(~(get by remotes) p)
|
|
|
|
?~(o a (~(dif in a) u.o))
|
2017-04-28 20:40:12 +03:00
|
|
|
:: subscriber update.
|
2017-05-03 19:39:23 +03:00
|
|
|
(so-report-crowd(locals loc.nep, remotes rem.nep) so-followers)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %changes
|
|
|
|
::> ||
|
|
|
|
::> arms that make miscelaneous changes to this story.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-reform ::< reconfigure
|
2017-04-27 00:33:25 +03:00
|
|
|
::> changes the config of this story and notify
|
2017-04-21 00:59:36 +03:00
|
|
|
::> our followers.
|
|
|
|
::> subscribes to new sources, unsubs from removed
|
|
|
|
::> ones.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= cof/config
|
2017-04-28 20:40:12 +03:00
|
|
|
?: =(cof shape) +>
|
2017-04-21 00:59:36 +03:00
|
|
|
=. +>.$ (so-inform %confs `cof ~)
|
|
|
|
=/ dif/(pair (list partner) (list partner))
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ old=`(list partner)`(~(tap in src.shape) ~)
|
|
|
|
=+ new=`(list partner)`(~(tap in src.cof) ~)
|
|
|
|
:- (skip new |=(a/partner (~(has in src.shape) a)))
|
|
|
|
(skip old |=(a/partner (~(has in src.cof) a)))
|
2017-04-21 00:59:36 +03:00
|
|
|
=. +>.$ (so-acquire p.dif)
|
|
|
|
=. +>.$ (so-abjure q.dif)
|
2017-03-23 03:34:56 +03:00
|
|
|
=. shape cof
|
2017-04-27 00:33:25 +03:00
|
|
|
(so-report-lobby so-followers)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-reform-gone ::< delete story
|
|
|
|
::> deletes this story. removes it from {stories}
|
2017-04-24 21:17:56 +03:00
|
|
|
::> and unsubscribes from all src.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
=. stories (~(del by stories) nom)
|
|
|
|
=. . (so-inform %confs ~ ~)
|
2017-04-27 00:33:25 +03:00
|
|
|
=. . (so-report-lobby so-followers)
|
2017-04-24 21:17:56 +03:00
|
|
|
(so-abjure (~(tap in src.shape)))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-notify ::< local presence
|
|
|
|
::> add {her} status to this story's presence map.
|
|
|
|
::> if this changes it, send a report.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {her/ship sat/status}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-24 21:17:56 +03:00
|
|
|
=/ nol (~(put by locals) her sat)
|
2017-03-23 03:34:56 +03:00
|
|
|
?: =(nol locals) +>.$
|
2017-04-24 21:17:56 +03:00
|
|
|
=. +>.$ (so-inform %precs (strap her sat) ~)
|
2017-05-03 19:39:23 +03:00
|
|
|
(so-report-crowd(locals nol) so-followers)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %subscriptions
|
|
|
|
::> ||
|
|
|
|
::> arms for starting and ending subscriptions
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-acquire ::< subscribe us
|
|
|
|
::> subscribes this story to each partner.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= pas/(list partner)
|
|
|
|
%+ so-sauce 0 :: subscription is caused by this app
|
|
|
|
%- zing
|
|
|
|
%+ turn pas
|
|
|
|
|= pan/partner
|
|
|
|
^- (list card)
|
|
|
|
::> subscribe starting at the last message we got,
|
|
|
|
::> or if we haven't gotten any yet, messages
|
|
|
|
::> from up to a day ago.
|
|
|
|
=+ num=(~(get by sequence) pan)
|
|
|
|
=+ old=(sub now.bol ~d1) :: XX full backlog
|
|
|
|
=+ ini=?^(num (scot %ud u.num) (scot %da old))
|
|
|
|
?- -.pan
|
|
|
|
$| !! ::< passport partner
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
$& ::< circle partner
|
2017-04-21 00:59:36 +03:00
|
|
|
:_ ~
|
|
|
|
:* %peer
|
2017-04-24 21:17:56 +03:00
|
|
|
/friend/show/[nom]/(scot %p hos.p.pan)/[nom.p.pan]
|
|
|
|
[hos.p.pan %talk-guardian]
|
|
|
|
/[nom.p.pan]/[ini]
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-abjure ::< unsubscribe us
|
|
|
|
::> unsubscribes this story from each partner.
|
|
|
|
::
|
|
|
|
|= pas/(list partner)
|
|
|
|
%+ so-sauce 0 :: subscription is caused by this app
|
|
|
|
%- zing
|
|
|
|
%+ turn pas
|
|
|
|
|= pan/partner
|
|
|
|
^- (list card)
|
|
|
|
?- -.pan
|
|
|
|
$| !! ::< passport partner
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
$& ::< circle partner
|
2017-04-21 00:59:36 +03:00
|
|
|
:_ ~
|
|
|
|
:* %pull
|
2017-04-24 21:17:56 +03:00
|
|
|
/friend/show/[nom]/(scot %p hos.p.pan)/[nom.p.pan]
|
|
|
|
[hos.p.pan %talk-guardian]
|
2017-04-21 00:59:36 +03:00
|
|
|
~
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ so-quit ::< subscription failed
|
|
|
|
::> delete {pan} from our subscriptions, then send
|
|
|
|
::> an updated capal report.
|
|
|
|
::
|
|
|
|
|= pan/partner
|
|
|
|
^+ +>
|
2017-04-24 21:17:56 +03:00
|
|
|
?. (~(has in src.shape) pan) +>
|
|
|
|
=. src.shape (~(del in src.shape) pan)
|
2017-04-21 00:59:36 +03:00
|
|
|
=. +> (so-inform %confs `shape ~)
|
2017-04-27 00:33:25 +03:00
|
|
|
(so-report-lobby so-followers)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so-start ::< subscribe follower
|
|
|
|
::> called upon subscribe. deduces the range of
|
|
|
|
::> {her} subscription from {pax}, then sends
|
|
|
|
::> the currently available part of it.
|
|
|
|
::
|
|
|
|
|= {her/ship pax/path}
|
|
|
|
^+ +>
|
2017-04-25 14:33:02 +03:00
|
|
|
:: read permissions
|
|
|
|
?. (so-visible her)
|
|
|
|
=. +>
|
|
|
|
(so-sauce ost.bol [%quit ~]~)
|
|
|
|
%- so-note %- crip
|
|
|
|
"so-start permission denied {(scow %p her)}"
|
|
|
|
:: find grams range
|
|
|
|
=/ ruv/(unit river)
|
|
|
|
:: collapse unit list
|
|
|
|
%+ biff
|
|
|
|
%- zl:jo
|
|
|
|
%+ turn pax
|
|
|
|
;~(biff slay |=(a/coin `(unit dime)`?~(-.a a ~)))
|
|
|
|
|= paf/(list dime)
|
|
|
|
?~ paf
|
|
|
|
$(paf [%ud (sub (max 64 count) 64)]~)
|
|
|
|
?~ t.paf
|
|
|
|
$(t.paf [%da (dec (bex 128))]~)
|
|
|
|
?. ?=({{?($ud $da) @} {?($ud $da) @} $~} paf)
|
|
|
|
~
|
|
|
|
`[[?+(- . $ud .)]:i.paf [?+(- . $ud .)]:i.t.paf] ::XX arvo issue #366
|
2017-04-21 00:59:36 +03:00
|
|
|
?~ ruv
|
2017-04-25 14:33:02 +03:00
|
|
|
=. +>.$
|
|
|
|
(so-sauce ost.bol [%quit ~]~)
|
|
|
|
%- so-note %- crip
|
|
|
|
"so-start malformed path {~(ram re >pax<)}"
|
2017-04-21 00:59:36 +03:00
|
|
|
(so-first-grams u.ruv)
|
|
|
|
::
|
|
|
|
++ so-first-grams ::< beginning of stream
|
|
|
|
::> find all grams that fall within the river and
|
|
|
|
::> send them in a grams report to {ost.bol}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= riv/river
|
|
|
|
^+ +>
|
2017-04-18 19:59:29 +03:00
|
|
|
=; lab/{dun/? end/@u zeg/(list telegram)}
|
2017-03-23 03:34:56 +03:00
|
|
|
=. +>.$
|
2017-04-21 00:59:36 +03:00
|
|
|
(so-sauce ost.bol [[%diff %talk-report %grams end.lab zeg.lab] ~])
|
2017-04-18 19:59:29 +03:00
|
|
|
?: dun.lab
|
2017-04-21 00:59:36 +03:00
|
|
|
(so-sauce ost.bol [[%quit ~] ~])
|
|
|
|
+>.$(followers (~(put by followers) ost.bol riv))
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ [end=count gaz=grams dun=| zeg=*(list telegram)]
|
|
|
|
|- ^- (trel ? @ud (list telegram))
|
|
|
|
?~ gaz [dun end zeg]
|
|
|
|
?: ?- -.q.riv :: after the end
|
|
|
|
$ud (lte p.q.riv end)
|
2017-04-24 21:17:56 +03:00
|
|
|
$da (lte p.q.riv wen.sam.tot.i.gaz)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
:: if past the river, continue back, mark as done.
|
2017-04-18 19:59:29 +03:00
|
|
|
$(end (dec end), gaz t.gaz, dun &)
|
2017-03-23 03:34:56 +03:00
|
|
|
?: ?- -.p.riv :: before the start
|
|
|
|
$ud (lth end p.p.riv)
|
2017-04-24 21:17:56 +03:00
|
|
|
$da (lth wen.sam.tot.i.gaz p.p.riv)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
:: if before the river, we're done searching.
|
2017-03-23 03:34:56 +03:00
|
|
|
[dun end zeg]
|
2017-04-21 17:14:11 +03:00
|
|
|
:: if in the river, add this gram and continue.
|
2017-03-23 03:34:56 +03:00
|
|
|
$(end (dec end), gaz t.gaz, zeg [i.gaz zeg])
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-cancel ::< unsubscribe follower
|
|
|
|
::> removes {ost.bol} from our followers.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
.(followers (~(del by followers) ost.bol))
|
|
|
|
::
|
|
|
|
++ so-eject ::< unsubscribe ships
|
|
|
|
::> removes ships {sis} from {followers}.
|
|
|
|
::
|
|
|
|
|= sis/(set ship)
|
|
|
|
%= +>
|
|
|
|
followers
|
|
|
|
%- ~(rep in (so-unearth sis))
|
|
|
|
|= {b/bone f/_followers}
|
|
|
|
=. f ?~(f followers f) ::TODO =?
|
|
|
|
(~(del by f) b)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %messaging
|
|
|
|
::> ||
|
|
|
|
::> arms for adding to this story's messages.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ so-refresh ::< update to listeners
|
|
|
|
::> called when messages get added or changed.
|
|
|
|
::> calculates the changes and sends them to all
|
|
|
|
::> followers.
|
|
|
|
::> any followers that are no longer interested
|
|
|
|
::> get removed.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= {num/@ud gam/telegram}
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
::> notify the interested readers.
|
|
|
|
=. +> (so-inform %grams num gam ~)
|
|
|
|
::> notify only the followers who are currently interested.
|
|
|
|
=/ moy
|
2017-04-25 22:09:20 +03:00
|
|
|
^- (pair (list bone) (list move))
|
|
|
|
%- ~(rep in followers)
|
|
|
|
|= {f/(pair bone river) r/(pair (list bone) (list move))}
|
|
|
|
:: after the end: unsubscribe
|
|
|
|
?: ?- -.q.q.f
|
|
|
|
$ud (lte p.q.q.f num)
|
|
|
|
$da (lte p.q.q.f wen.sam.tot.gam)
|
|
|
|
==
|
|
|
|
[[p.f p.r] [[p.f %quit ~] q.r]]
|
|
|
|
:: before the start: ignore
|
|
|
|
?: ?- -.p.q.f
|
|
|
|
$ud (gth p.p.q.f num)
|
|
|
|
$da (gth p.p.q.f wen.sam.tot.gam)
|
|
|
|
==
|
|
|
|
r
|
|
|
|
:: in the river: send gram
|
|
|
|
:- p.r
|
|
|
|
[[p.f %diff %talk-report %grams num gam ~] q.r]
|
2017-03-29 18:03:59 +03:00
|
|
|
=. moves (welp q.moy moves)
|
2017-03-23 03:34:56 +03:00
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ p.moy +>.^$
|
2017-03-25 02:54:56 +03:00
|
|
|
$(p.moy t.p.moy, followers (~(del by followers) i.p.moy))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-lesson ::< learn messages
|
|
|
|
::> learn all telegrams in a list.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= gaz/(list telegram)
|
|
|
|
^+ +>
|
|
|
|
?~ gaz +>
|
2017-04-21 00:59:36 +03:00
|
|
|
$(gaz t.gaz, +> (so-learn i.gaz))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-learn ::< save/update message
|
|
|
|
::> store an incoming telegram, updating if it
|
|
|
|
::> already exists.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
2017-04-24 21:17:56 +03:00
|
|
|
?. (so-admire aut.gam) ::< write permissions
|
2017-03-23 03:34:56 +03:00
|
|
|
+>.$
|
2017-04-24 21:17:56 +03:00
|
|
|
=. aud.tot.gam
|
2017-04-21 00:59:36 +03:00
|
|
|
::> if we are in the audience, mark as received.
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ ole=(~(get by aud.tot.gam) [%& our.bol nom])
|
|
|
|
?^ ole (~(put by aud.tot.gam) [%& our.bol nom] -.u.ole %received)
|
|
|
|
::> federated circles need to pretend ~src/nom
|
2017-04-21 00:59:36 +03:00
|
|
|
::> is also ~our/nom.
|
|
|
|
::TODO pass src through explicitly instead of
|
2017-04-25 22:09:20 +03:00
|
|
|
:: relying on src.bol.
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ ole=(~(get by aud.tot.gam) [%& src.bol nom])
|
|
|
|
?~ ole aud.tot.gam
|
2017-04-21 00:59:36 +03:00
|
|
|
::> as described above, fake src into our.
|
2017-04-24 21:17:56 +03:00
|
|
|
=. aud.tot.gam (~(del by aud.tot.gam) [%& src.bol nom])
|
|
|
|
(~(put by aud.tot.gam) [%& our.bol nom] -.u.ole %received)
|
|
|
|
=+ old=(~(get by known) uid.tot.gam)
|
2017-03-23 03:34:56 +03:00
|
|
|
?~ old
|
2017-04-21 00:59:36 +03:00
|
|
|
(so-append gam) ::< add
|
|
|
|
(so-revise u.old gam) ::< modify
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-append ::< append message
|
|
|
|
::> add gram to our story, send report to subs.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
%+ %= so-refresh
|
2017-03-23 03:34:56 +03:00
|
|
|
grams [gam grams]
|
|
|
|
count +(count)
|
2017-04-24 21:17:56 +03:00
|
|
|
known (~(put by known) uid.tot.gam count)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
count
|
|
|
|
gam
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-revise ::< revise message
|
|
|
|
::> modify gram in our story, send report to subs.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= {num/@ud gam/telegram}
|
2017-04-21 00:59:36 +03:00
|
|
|
::> dex: index in grams list to insert message at.
|
|
|
|
=+ dex=(sub count num)
|
|
|
|
?: =(gam (snag (dec dex) grams)) +>.$ ::< no change
|
|
|
|
=. grams
|
|
|
|
%+ welp
|
|
|
|
(scag (dec dex) grams)
|
|
|
|
[gam (slag dex grams)]
|
|
|
|
(so-refresh num gam)
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %permissions
|
|
|
|
::> ||
|
|
|
|
::> arms relating to story permissions.
|
|
|
|
::+|
|
2017-04-14 17:41:49 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-permit ::< invite/banish
|
|
|
|
::> update config to dis/allow ships permission.
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
|
|
|
|= {inv/? sis/(set ship)}
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
::> wyt: whitelist?
|
|
|
|
::> add: add to list?
|
2017-04-24 21:17:56 +03:00
|
|
|
=/ wyt/? ?=(?($white $green) sec.con.shape)
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ add/? =(inv wyt)
|
2017-04-14 17:41:49 +03:00
|
|
|
=. +>.$ ::TODO =?
|
|
|
|
?: inv +>.$
|
2017-04-21 00:59:36 +03:00
|
|
|
(so-eject sis)
|
2017-04-10 23:35:25 +03:00
|
|
|
=. +>.$
|
2017-04-21 00:59:36 +03:00
|
|
|
%- so-act
|
2017-04-14 01:46:15 +03:00
|
|
|
:- %phrase
|
2017-04-10 23:35:25 +03:00
|
|
|
%- ~(rep in sis)
|
2017-04-14 01:46:15 +03:00
|
|
|
|= {s/ship a/(set partner) t/(list speech)}
|
|
|
|
:- (~(put in a) [%& s (main s)])
|
2017-04-21 00:59:36 +03:00
|
|
|
[[%inv inv [our.bol nom]] t]
|
|
|
|
%- so-reform
|
2017-04-10 23:35:25 +03:00
|
|
|
%= shape
|
2017-04-24 21:17:56 +03:00
|
|
|
ses.con
|
2017-04-10 23:35:25 +03:00
|
|
|
%. sis
|
|
|
|
?: add
|
2017-04-24 21:17:56 +03:00
|
|
|
~(uni in ses.con.shape)
|
|
|
|
~(dif in ses.con.shape)
|
2017-04-10 23:35:25 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so-admire ::< accept from
|
|
|
|
::> checks {her} write permissions.
|
|
|
|
::
|
|
|
|
|= her/ship
|
|
|
|
^- ?
|
2017-04-24 21:17:56 +03:00
|
|
|
?- sec.con.shape
|
|
|
|
$black !(~(has in ses.con.shape) her) ::< channel, blacklist
|
|
|
|
$white (~(has in ses.con.shape) her) ::< village, whitelist
|
|
|
|
$green (~(has in ses.con.shape) her) ::< journal, whitelist
|
|
|
|
$brown !(~(has in ses.con.shape) her) ::< mailbox, blacklist
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ so-visible ::< display to
|
|
|
|
::> checks {her} read permissions.
|
|
|
|
::
|
|
|
|
|= her/ship
|
|
|
|
^- ?
|
2017-04-24 21:17:56 +03:00
|
|
|
?- sec.con.shape
|
|
|
|
$black !(~(has in ses.con.shape) her) ::< channel, blacklist
|
|
|
|
$white (~(has in ses.con.shape) her) ::< village, whitelist
|
2017-04-21 00:59:36 +03:00
|
|
|
$green & ::< journal, all
|
|
|
|
$brown (team our.bol her) ::< mailbox, our team
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %wire-parsing
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ etch ::< parse wire
|
|
|
|
::> parses {wir}} to obtain either %friend with story
|
2017-04-24 21:17:56 +03:00
|
|
|
::> and circle or %repeat with message number,
|
2017-04-21 00:59:36 +03:00
|
|
|
::> source ship and story.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= wir/wire
|
|
|
|
^- weir
|
|
|
|
?+ -.wir !!
|
|
|
|
$friend
|
|
|
|
?> ?=({$show @ @ @ $~} t.wir)
|
|
|
|
:^ %friend
|
|
|
|
i.t.t.wir
|
|
|
|
(slav %p i.t.t.t.wir)
|
|
|
|
i.t.t.t.t.wir
|
|
|
|
::
|
|
|
|
$repeat
|
|
|
|
?> ?=({@ @ @ $~} t.wir)
|
|
|
|
:^ %repeat
|
|
|
|
(slav %ud i.t.wir)
|
|
|
|
(slav %p i.t.t.wir)
|
|
|
|
i.t.t.t.wir
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ etch-friend ::< parse /friend wire
|
|
|
|
::> parses a /friend wire, call a gate with the result.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= $: wir/wire
|
|
|
|
$= fun
|
2017-04-25 22:18:14 +03:00
|
|
|
$- {nom/knot cir/circle}
|
2017-04-21 00:59:36 +03:00
|
|
|
{(list move) _.}
|
|
|
|
==
|
|
|
|
=+ wer=(etch wir)
|
2017-04-27 14:21:17 +03:00
|
|
|
?>(?=($friend -.wer) (fun nom.wer cir.wer))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ etch-repeat ::< parse /repeat wire
|
|
|
|
::> parses a /repeat wire, call gate with the result.
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= $: wir/wire
|
|
|
|
$= fun
|
|
|
|
$- {num/@ud src/ship nom/knot}
|
|
|
|
{(list move) _.}
|
|
|
|
==
|
|
|
|
=+ wer=(etch wir)
|
2017-04-27 14:21:17 +03:00
|
|
|
?>(?=($repeat -.wer) (fun num.wer hos.wer nom.wer))
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %poke-events
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-command ::< accept command
|
|
|
|
::> incoming talk command. process it and update logs.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= cod/command
|
2017-03-23 03:34:56 +03:00
|
|
|
^- (quip move +>)
|
|
|
|
=^ mos +>.$
|
2017-04-21 00:59:36 +03:00
|
|
|
ta-done:(ta-apply:ta src.bol cod)
|
|
|
|
=^ mow +>.$
|
|
|
|
log-all-to-file
|
2017-03-23 03:34:56 +03:00
|
|
|
[(welp mos mow) +>.$]
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-action ::< accept action
|
|
|
|
::> incoming talk action. process it.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= act/action
|
|
|
|
^- (quip move +>)
|
|
|
|
?. (team src.bol our.bol)
|
2017-04-25 14:33:02 +03:00
|
|
|
=< ta-done
|
|
|
|
%- ta-note:ta %- crip
|
|
|
|
"talk-action stranger {(scow %p src.bol)}"
|
2017-04-21 00:59:36 +03:00
|
|
|
ta-done:(ta-action:ta ost.bol act)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-comment ::< do comment
|
|
|
|
::> sends a comment.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pax/path sup/spur txt/@t}
|
|
|
|
^- (quip move +>)
|
|
|
|
ta-done:(ta-comment:ta pax sup txt)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-fora-post ::< do fora post
|
|
|
|
::> sends a fora post.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pax/path sup/spur hed/@t txt/@t}
|
|
|
|
^- (quip move +>)
|
|
|
|
ta-done:(ta-fora-post:ta pax sup hed txt)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %subscription-events
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ diff-talk-report ::< accept report
|
|
|
|
::> incoming talk-report. process it and update logs.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {wir/wire ret/report}
|
2017-03-23 03:34:56 +03:00
|
|
|
^- (quip move +>)
|
2017-04-21 00:59:36 +03:00
|
|
|
=^ mos +>.$
|
|
|
|
%+ etch-friend wir
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {nom/knot cir/circle}
|
|
|
|
ta-done:(ta-diff-report:ta nom cir ret)
|
2017-04-21 00:59:36 +03:00
|
|
|
=^ mow +>.$
|
|
|
|
log-all-to-file
|
|
|
|
[(welp mos mow) +>.$]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ peer ::< accept subscription
|
|
|
|
::> incoming subscription on {pax}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= pax/path
|
|
|
|
^- (quip move +>)
|
|
|
|
?: ?=({$sole *} pax) ~&(%talk-broker-no-sole !!)
|
|
|
|
ta-done:(ta-subscribe:ta src.bol pax)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ pull ::< unsubscribe
|
|
|
|
::> unsubscribes.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= pax/path
|
2017-04-21 00:59:36 +03:00
|
|
|
^- (quip move +>)
|
|
|
|
ta-done:(ta-cancel:ta src.bol pax)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ reap-friend ::< subscription n/ack
|
|
|
|
::> if subscribing failed, update state to reflect
|
|
|
|
::> that.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::TODO this should deal with /reader subscriptions too.
|
|
|
|
|= {wir/wire fal/(unit tang)}
|
|
|
|
^- (quip move +>)
|
|
|
|
?~ fal [~ +>]
|
|
|
|
%+ etch-friend [%friend wir]
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {nom/knot cir/circle}
|
|
|
|
=. u.fal [>%reap-friend-fail nom cir< u.fal]
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (slog (flop u.fal))
|
2017-04-25 22:18:14 +03:00
|
|
|
ta-done:(ta-quit:ta nom cir)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ quit-friend ::< dropped subscription
|
|
|
|
::> gall dropped our subscription. resubscribe.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= wir/wire
|
|
|
|
^- (quip move +>)
|
|
|
|
%+ etch-friend [%friend wir]
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {nom/knot cir/circle}
|
|
|
|
ta-done:(ta-retry:ta nom cir)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ coup-repeat ::< message n/ack
|
|
|
|
::> ack from ++ta-transmit. mark the message as
|
|
|
|
::> received or rejected.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {wir/wire fal/(unit tang)}
|
|
|
|
^- (quip move +>)
|
|
|
|
%+ etch-repeat [%repeat wir]
|
|
|
|
|= {num/@ud src/ship nom/knot}
|
|
|
|
ta-done:(ta-coup-repeat:ta [num src nom] fal)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %logging
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-save ::< save as log
|
|
|
|
::> stores the telegrams of story {nom} in a log file,
|
|
|
|
::> to be re-loaded by ++poke-talk-load.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= nom/knot
|
2017-03-23 03:34:56 +03:00
|
|
|
^- (quip move +>)
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ paf/path
|
|
|
|
/(scot %p our.bol)/home/(scot %da now.bol)/talk/[nom]/talk-telegrams
|
|
|
|
=+ grams:(~(got by stories) nom)
|
|
|
|
:_ +>.$
|
|
|
|
:_ ~
|
|
|
|
:* ost.bol
|
|
|
|
%info
|
|
|
|
/jamfile
|
|
|
|
our.bol
|
|
|
|
(foal paf [%talk-telegrams !>(-)])
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-load ::< load from log
|
|
|
|
::> loads the telegrams of story {nom} into our state,
|
|
|
|
::> as saved in ++poke-talk-save.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= nom/knot
|
|
|
|
^- (quip move +>)
|
|
|
|
=/ grams
|
|
|
|
.^ (list telegram)
|
|
|
|
%cx
|
|
|
|
/(scot %p our.bol)/home/(scot %da now.bol)/talk/[nom]/talk-telegrams
|
|
|
|
==
|
|
|
|
=+ soy=(~(got by stories) nom)
|
|
|
|
:- ~
|
|
|
|
%= +>.$
|
|
|
|
stories
|
|
|
|
%+ ~(put by stories) nom
|
|
|
|
soy(grams grams, count (lent grams))
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-log ::< start logging
|
|
|
|
::> starts logging story {nom}'s messages.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= nom/knot
|
|
|
|
~& %talk-poke-log
|
2017-03-23 03:34:56 +03:00
|
|
|
^- (quip move +>)
|
2017-04-21 00:59:36 +03:00
|
|
|
:- [(log-to-file nom) ~]
|
|
|
|
%= +>.$
|
|
|
|
log
|
|
|
|
%+ ~(put by log) nom
|
|
|
|
count:(~(got by stories) nom)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-unlog ::< stop logging
|
|
|
|
::> stops logging story {nom}'s messages.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= nom/knot
|
2017-03-23 03:34:56 +03:00
|
|
|
^- (quip move +>)
|
|
|
|
:- ~
|
2017-04-21 00:59:36 +03:00
|
|
|
+>.$(log (~(del by log) nom))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ log-all-to-file ::< update stories logs
|
|
|
|
::> for every story we're logging, (over)writes all
|
|
|
|
::> their grams to log files if new ones have arrived.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::TODO re-enable and test.
|
|
|
|
^- (quip move .)
|
|
|
|
?: & [~ .] :: XXX!!!!
|
|
|
|
:_ %_ .
|
|
|
|
log
|
|
|
|
%- ~(urn by log)
|
|
|
|
|= {nom/knot len/@ud}
|
|
|
|
count:(~(got by stories) nom)
|
|
|
|
==
|
|
|
|
%+ murn (~(tap by log))
|
|
|
|
|= {nom/knot len/@ud}
|
|
|
|
^- (unit move)
|
|
|
|
?: (gte len count:(~(got by stories) nom))
|
|
|
|
~
|
|
|
|
`(log-to-file nom)
|
|
|
|
::
|
|
|
|
++ log-to-file ::< update story log
|
|
|
|
::> logs all grams of story {nom} to a file.
|
|
|
|
::
|
|
|
|
|= nom/knot
|
|
|
|
^- move
|
|
|
|
=+ ^- paf/path
|
|
|
|
=+ day=(year %*(. (yore now.bol) +.t +:*tarp))
|
|
|
|
%+ tope [our.bol %home da+now.bol]
|
|
|
|
/talk-telegrams/(scot %da day)/[nom]/talk
|
|
|
|
=+ grams:(~(got by stories) nom)
|
|
|
|
[ost.bol %info /jamfile our.bol (foal paf [%talk-telegrams !>(-)])]
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|