1
1
mirror of https://github.com/urbit/shrub.git synced 2024-12-30 07:35:19 +03:00
shrub/pkg/arvo/app/publish.hoon

1445 lines
37 KiB
Plaintext
Raw Normal View History

::
2019-07-12 01:07:05 +03:00
:: /app/publish.hoon
::
2019-07-12 01:07:05 +03:00
/- hall, *publish
/+ *server, *publish
::
/= index
/^ $-(json manx)
2019-07-12 01:07:05 +03:00
/: /===/app/publish/index /!noun/
::
/= js
/^ octs
/; as-octs:mimes:html
2019-07-12 01:07:05 +03:00
/| /: /===/app/publish/js/index /js/
/~ ~
==
::
/= css
/^ octs
/; as-octs:mimes:html
2019-07-12 01:07:05 +03:00
/| /: /===/app/publish/css/index /css/
/~ ~
==
::
2019-06-21 23:24:33 +03:00
/= tile-js
/^ octs
/; as-octs:mimes:html
2019-07-12 01:07:05 +03:00
/| /: /===/app/publish/js/tile /js/
2019-06-21 23:24:33 +03:00
/~ ~
==
::
/= images
/^ (map knot @)
2019-07-12 01:07:05 +03:00
/: /===/app/publish/img /_ /png/
2019-06-21 23:24:33 +03:00
::
|%
::
+$ move [bone card]
::
+$ card
$% [%info wire toro:clay]
[%poke wire dock poke]
[%perm wire desk path rite:clay]
[%peer wire dock path]
[%pull wire dock ~]
[%quit ~]
[%diff diff]
[%build wire ? schematic:ford]
[%kill wire ~]
[%connect wire binding:eyre term]
[%http-response http-event:http]
[%disconnect binding:eyre]
==
::
+$ poke
$% [%hall-action action:hall]
2019-07-12 01:07:05 +03:00
[%publish-action action]
[%launch-action @tas path @t]
==
::
+$ diff
$% [%hall-rumor rumor:hall]
[%json json]
2019-07-12 01:07:05 +03:00
[%publish-collection collection]
[%publish-rumor rumor]
[%publish-update update]
==
::
--
::
2019-07-11 21:32:30 +03:00
|_ [bol=bowl:gall %0 sat=state]
::
++ this .
:: +our-beak: beak for this app, with case set to current invocation date
::
++ our-beak /(scot %p our.bol)/[q.byk.bol]/(scot %da now.bol)
2019-07-11 21:32:30 +03:00
:: +prep: set up eyre connection and modulo tile; adapt state
::
++ prep
=> |%
++ states
$% [%0 s=state]
==
--
|= old=(unit states)
^- (quip move _this)
?~ old
:_ this
2019-07-12 01:07:05 +03:00
:~ [ost.bol %connect / [~ /'~publish'] %publish]
2019-07-11 21:32:30 +03:00
:* ost.bol %poke /publish [our.bol %launch]
2019-07-12 01:07:05 +03:00
%launch-action %publish /publishtile '/~publish/tile.js'
2019-07-11 21:32:30 +03:00
==
==
?- -.u.old
%0 [~ this(sat s.u.old)]
==
2019-06-21 23:24:33 +03:00
::
2019-06-27 03:15:16 +03:00
++ ships-to-whom
|= ships=(set @p)
^- (set whom:clay)
%- ~(run in ships)
|= who=@p
^- whom:clay
[%.y who]
::
++ get-contributors
|= coll=@tas
^- [mod=?(%white %black) who=(set @p)]
2019-07-12 01:07:05 +03:00
=/ pax (weld our-beak /web/publish/[coll])
2019-06-27 03:15:16 +03:00
=/ pem=[r=dict:clay w=dict:clay] .^([dict:clay dict:clay] %cp pax)
:- mod.rul.w.pem
(resolve-real rul.w.pem)
::
++ resolve-real
|= rel=real:clay
^- (set @p)
%- ~(uni in p.who.rel)
%- (set @p)
%- ~(rep by q.who.rel)
|= [[@ta cru=crew:clay] out=(set @p)]
^- (set @p)
(~(uni in out) cru)
::
++ whom-to-ships
|= whoms=(set whom:clay)
^- (set @p)
%- ~(rep in whoms)
|= [who=whom:clay out=(set @p)]
?: ?=(%.y -.who)
(~(put in out) p.who)
out
2019-06-21 23:24:33 +03:00
::
++ allowed
|= [who=@p mod=?(%read %write) pax=path]
^- ?
=. pax (weld our-beak pax)
=/ pem=[dict:clay dict:clay] .^([dict:clay dict:clay] %cp pax)
?- mod
%read (allowed-by who -.pem)
%write (allowed-by who +.pem)
==
:: +allowed-by: checks if ship :who is allowed by the permission rules in :dic
::
++ allowed-by
|= [who=@p dic=dict:clay]
^- ?
?: =(who our.bol) &
=/ in-list=?
?| (~(has in p.who.rul.dic) who)
::
%- ~(rep by q.who.rul.dic)
|= [[@ta cru=crew:clay] out=_|]
?: out &
(~(has in cru) who)
==
?: =(%black mod.rul.dic)
!in-list
in-list
:: +write-file: write file at path
::
++ write-file
=, space:userlib
|= [pax=path cay=cage]
^- move
=. pax (weld our-beak pax)
[ost.bol %info (weld /write-file pax) (foal pax cay)]
::
2019-06-27 03:15:16 +03:00
++ delete-file
=, space:userlib
|= pax=path
^- move
=. pax (weld our-beak pax)
[ost.bol %info (weld /write-file pax) (fray pax)]
::
++ update-udon-front
|= [fro=(map knot cord) udon=@t]
^- @t
%- of-wain:format
=/ tum (trip udon)
=/ id (find ";>" tum)
?~ id
%+ weld (front-to-wain fro)
(to-wain:format (crip (weld ";>\0a" tum)))
%+ weld (front-to-wain fro)
(to-wain:format (crip (slag u.id tum)))
::
++ front-to-wain
|= a=(map knot cord)
^- wain
=/ entries=wain
%+ turn ~(tap by a)
|= b=[knot cord]
=/ c=[term cord] (,[term cord] b)
(crip " [{<-.c>} {<+.c>}]")
::
?~ entries ~
;: weld
[':- :~' ~]
entries
[' ==' ~]
==
::
++ poke-noun
|= a=*
^- (quip move _this)
?. =(src.bol our.bol)
[~ this]
?+ a
[~ this]
::
2019-06-27 03:15:16 +03:00
%print-bowl
~& bol
[~ this]
::
%print-state
~& sat
[~ this]
::
==
::
++ da
|_ moves=(list move)
::
++ da-this .
::
++ da-done
^- (quip move _this)
[(flop moves) this]
::
++ da-emit
|= mov=move
%_ da-this
moves [mov moves]
==
::
++ da-emil
|= mov=(list move)
%_ da-this
moves (welp (flop mov) moves)
==
::
++ da-change
|= del=delta
^+ da-this
?- -.del
::
%collection
=/ old=(unit collection)
?: =(our.bol who.del)
(~(get by pubs.sat) col.del)
(~(get by subs.sat) who.del col.del)
=/ new=collection
?~ old
2019-06-27 03:15:16 +03:00
[[ost.bol dat.del] ~ ~ [~ ~] [%white ~] ~ now.bol]
u.old(col [ost.bol dat.del], last-update now.bol)
=? contributors.new =(our.bol who.del)
(get-contributors col.del)
=? pubs.sat =(our.bol who.del)
(~(put by pubs.sat) col.del new)
=? subs.sat !=(our.bol who.del)
(~(put by subs.sat) [who.del col.del] new)
(da-emil (affection del))
::
%post
=/ old=(unit collection)
?: =(our.bol who.del)
(~(get by pubs.sat) col.del)
(~(get by subs.sat) who.del col.del)
=/ new=collection
?~ old
2019-06-27 03:15:16 +03:00
:* [0 %.n ~] (my [pos.del ost.bol dat.del] ~) ~
[~ ~] [%white ~] ~ now.bol
==
%= u.old
pos (~(put by pos.u.old) pos.del [ost.bol dat.del])
last-update now.bol
==
=? pubs.sat =(our.bol who.del)
(~(put by pubs.sat) col.del new)
=? subs.sat !=(our.bol who.del)
(~(put by subs.sat) [who.del col.del] new)
2019-06-27 03:15:16 +03:00
=? da-this -.dat.del
(da-insert who.del col.del pos.del)
(da-emil (affection del))
::
%comments
=/ old=(unit collection)
?: =(our.bol who.del)
(~(get by pubs.sat) col.del)
(~(get by subs.sat) who.del col.del)
=/ new=collection
?~ old
2019-06-27 03:15:16 +03:00
:* [0 %.n ~] ~ (my [pos.del ost.bol dat.del] ~)
[~ ~] [%white ~] ~ now.bol
==
%= u.old
com (~(put by com.u.old) pos.del [ost.bol dat.del])
last-update now.bol
==
=? pubs.sat =(our.bol who.del)
(~(put by pubs.sat) col.del new)
=? subs.sat !=(our.bol who.del)
(~(put by subs.sat) [who.del col.del] new)
(da-emil (affection del))
::
%total
2019-06-27 03:15:16 +03:00
=? contributors.dat.del =(our.bol who.del)
(get-contributors col.del)
=? pubs.sat =(our.bol who.del)
(~(put by pubs.sat) col.del dat.del)
=? subs.sat !=(our.bol who.del)
2019-06-17 21:39:53 +03:00
(~(put by subs.sat) [who.del col.del] dat.del(order [~ ~]))
::
2019-06-27 03:15:16 +03:00
=/ posts=(list [@tas bone (each [post-info manx @t] tang)])
~(tap by pos.dat.del)
=. da-this
|-
?~ posts
da-this
2019-06-27 03:15:16 +03:00
?. +>-.i.posts
$(posts t.posts)
%= $
2019-06-27 03:15:16 +03:00
da-this (da-insert who.del col.del -.i.posts)
posts t.posts
==
(da-emil (affection del))
2019-06-21 23:24:33 +03:00
::
%remove
2019-06-27 03:15:16 +03:00
:: remove blog
::
?~ pos.del
:: collect post ids for blog, delete blog, and sent out moves
::
=^ posts da-this
?: =(our.bol who.del)
:: if its our blog, we must send out notifications to subscribers
::
=/ old=(unit collection) (~(get by pubs.sat) col.del)
?~ old
2019-07-11 21:32:30 +03:00
[~ da-this]
2019-06-27 03:15:16 +03:00
=. pubs.sat (~(del by pubs.sat) col.del)
:- ~(tap in ~(key by pos.u.old))
(da-emil (affection del))
:: if its not our blog, we need to pull subscription
::
=/ old=(unit collection) (~(get by subs.sat) who.del col.del)
?~ old
2019-07-11 21:32:30 +03:00
[~ da-this]
2019-06-27 03:15:16 +03:00
=. subs.sat (~(del by subs.sat) who.del col.del)
:- ~(tap in ~(key by pos.u.old))
2019-07-19 01:34:42 +03:00
%- da-emil
:- [ost.bol %pull /collection/[col.del] [who.del %publish] ~]
(affection-primary del)
2019-06-27 03:15:16 +03:00
:: iterate through post ids collected before, removing each from
:: secondary indices in state
::
=. da-this
|-
?~ posts
da-this
%= $
da-this (da-remove who.del col.del i.posts)
posts t.posts
==
da-this
:: remove post
::
=/ old=(unit collection)
?: =(our.bol who.del)
(~(get by pubs.sat) col.del)
(~(get by subs.sat) who.del col.del)
?~ old
2019-07-11 21:32:30 +03:00
da-this
2019-06-27 03:15:16 +03:00
?. (~(has in ~(key by pos.u.old)) u.pos.del)
2019-07-11 21:32:30 +03:00
da-this
2019-06-27 03:15:16 +03:00
=/ new=collection
%= u.old
pos (~(del by pos.u.old) u.pos.del)
com (~(del by com.u.old) u.pos.del)
==
=. da-this (da-emil (affection del))
?: =(our.bol who.del)
=. pubs.sat (~(put by pubs.sat) col.del new)
=. da-this (da-remove who.del col.del u.pos.del)
(da-emil (affection del))
=. subs.sat (~(put by subs.sat) [who.del col.del] new)
2019-07-19 01:34:42 +03:00
=. da-this (da-remove who.del col.del u.pos.del)
(da-emil (affection-primary del))
2019-06-27 03:15:16 +03:00
::
==
::
++ da-remove-unread
|= [who=@p coll=@tas post=@tas]
^+ da-this
=. unread.sat (~(del in unread.sat) who coll post)
(da-emil make-tile-moves)
::
++ da-remove-latest
|= [who=@p coll=@tas post=@tas]
^+ da-this
=/ ids=(list @) (fand [who coll post]~ latest.sat)
=. latest.sat
|-
?~ ids
latest.sat
%= $
latest.sat (oust [i.ids 1] latest.sat)
ids t.ids
==
(da-emil make-tile-moves)
::
++ da-remove-order
|= [who=@p coll=@tas post=@tas]
^+ da-this
=/ col=(unit collection) (get-coll-by-index who coll)
?~ col
2019-06-21 23:24:33 +03:00
da-this
2019-06-27 03:15:16 +03:00
=/ new=collection u.col
2019-07-11 21:32:30 +03:00
=/ pin-ids=(list @) (fand [post]~ pin.order.new)
=. pin.order.new
2019-06-27 03:15:16 +03:00
|-
?~ pin-ids
2019-07-11 21:32:30 +03:00
pin.order.new
2019-06-27 03:15:16 +03:00
%= $
2019-07-11 21:32:30 +03:00
pin.order.new (oust [i.pin-ids 1] pin.order.new)
2019-06-27 03:15:16 +03:00
pin-ids t.pin-ids
==
::
2019-07-11 21:32:30 +03:00
=/ unpin-ids=(list @) (fand [post]~ unpin.order.new)
=. unpin.order.new
2019-06-27 03:15:16 +03:00
|-
?~ unpin-ids
2019-07-11 21:32:30 +03:00
unpin.order.new
2019-06-27 03:15:16 +03:00
%= $
2019-07-11 21:32:30 +03:00
unpin.order.new (oust [i.unpin-ids 1] unpin.order.new)
2019-06-27 03:15:16 +03:00
unpin-ids t.unpin-ids
==
2019-07-11 21:32:30 +03:00
=? pubs.sat =(who our.bol)
(~(put by pubs.sat) coll new)
=? subs.sat !=(who our.bol)
(~(put by subs.sat) [who coll] new)
2019-06-27 03:15:16 +03:00
(da-emil make-tile-moves)
::
++ da-remove
|= [who=@p coll=@tas post=@tas]
^+ da-this
=. da-this (da-remove-unread +<)
=. da-this (da-remove-latest +<)
=. da-this (da-remove-order +<)
da-this
::
2019-06-17 21:39:53 +03:00
++ da-insert-unread
|= [who=@p coll=@tas post=@tas]
^+ da-this
:: assume we've read our own posts
::
=? unread.sat !=(who our.bol)
(~(put in unread.sat) who coll post)
2019-06-21 23:24:33 +03:00
(da-emil make-tile-moves)
2019-06-17 21:39:53 +03:00
::
++ da-insert-latest
|= [who=@p coll=@tas post=@tas]
^+ da-this
2019-07-11 21:32:30 +03:00
=/ new-date=@da date-created:(need (get-post-info-by-index who coll post))
=/ pre=(list [@p @tas @tas]) ~
=/ suf=(list [@p @tas @tas]) latest.sat
2019-06-17 21:39:53 +03:00
=? latest.sat =(~ (find [who coll post]~ latest.sat))
|-
?~ suf
(weld pre [who coll post]~)
2019-07-11 21:32:30 +03:00
=/ i-date=@da date-created:(need (get-post-info-by-index i.suf))
2019-06-17 21:39:53 +03:00
?: (gte new-date i-date)
(weld pre [[who coll post] suf])
%= $
suf t.suf
pre (snoc pre i.suf)
==
da-this
::
++ da-insert-order
|= [who=@p coll=@tas post=@tas]
^+ da-this
2019-07-11 21:32:30 +03:00
=/ new-post=post-info (need (get-post-info-by-index who coll post))
=/ col=collection (need (get-coll-by-index who coll))
::
=/ pre=(list @tas) ~
=/ suf=(list @tas)
?: pinned.new-post
pin.order.col
unpin.order.col
::
2019-06-17 21:39:53 +03:00
?: ?=(^ (find [post]~ suf))
da-this
=/ new-list=(list @tas)
|-
?~ suf
(snoc pre post)
2019-06-17 21:39:53 +03:00
?: =(post i.suf)
(weld pre suf)
2019-07-11 21:32:30 +03:00
=/ i-date=@da date-created:(need (get-post-info-by-index who coll i.suf))
?: (gte date-created.new-post i-date)
(weld pre [post suf])
%= $
suf t.suf
pre (snoc pre i.suf)
==
::
=. order.col
?: pinned.new-post
[new-list unpin.order.col]
[pin.order.col new-list]
::
=? pubs.sat =(our.bol who)
(~(put by pubs.sat) coll col)
=? subs.sat !=(our.bol who)
(~(put by subs.sat) [who coll] col)
da-this
2019-06-17 21:39:53 +03:00
::
++ da-insert
|= [who=@p coll=@tas post=@tas]
^+ da-this
=. da-this (da-insert-unread +<)
=. da-this (da-insert-latest +<)
=. da-this (da-insert-order +<)
da-this
--
:: +bake: apply delta
::
++ bake
|= del=delta
^- (quip move _this)
da-done:(da-change:da del)
2019-07-19 01:34:42 +03:00
:: +affection: rumors to primary
::
++ affection-primary
|= del=delta
^- (list move)
%+ turn (prey:pubsub:userlib /primary bol)
|= [b=bone *]
^- move
[b %diff %publish-rumor del]
:: +affection: rumors to interested
::
++ affection
|= del=delta
^- (list move)
%- zing
%+ turn ~(tap by sup.bol)
|= [b=bone s=ship p=path]
^- (list move)
=/ rum=(unit rumor) (feel p del)
?~ rum
~
2019-07-12 01:07:05 +03:00
[b %diff %publish-rumor u.rum]~
:: +feel: delta to rumor
::
++ feel
|= [query=wire del=delta]
^- (unit rumor)
?+ query
~
[%primary ~]
[~ del]
::
[%collection @t ~]
=/ coll=@tas i.t.query
?: =(coll col.del)
[~ del]
~
::
==
::
++ get-post-by-index
2019-07-11 21:32:30 +03:00
|= [who=@p coll=@tas post=@tas]
^- (unit (each [post-info manx @t] tang))
=/ col=(unit collection)
?: =(our.bol who)
(~(get by pubs.sat) coll)
(~(get by subs.sat) who coll)
?~ col ~
=/ pos=(unit [bone (each [post-info manx @t] tang)])
(~(get by pos.u.col) post)
?~ pos ~
[~ +.u.pos]
::
++ get-post-info-by-index
|= [who=@p coll=@tas post=@tas]
^- (unit post-info)
=/ col=(unit collection)
?: =(our.bol who)
(~(get by pubs.sat) coll)
(~(get by subs.sat) who coll)
?~ col ~
2019-06-27 03:15:16 +03:00
=/ pos=(unit [bone (each [post-info manx @t] tang)])
(~(get by pos.u.col) post)
?~ pos ~
2019-06-27 03:15:16 +03:00
?: ?=(%.n -.+.u.pos) ~
[~ -.p.+.u.pos]
::
++ get-coll-by-index
|= [who=@p coll=@tas]
^- (unit collection)
?: =(our.bol who)
(~(get by pubs.sat) coll)
2019-06-17 21:39:53 +03:00
(~(get by subs.sat) who coll)
::
++ made
|= [wir=wire wen=@da mad=made-result:ford]
^- (quip move _this)
?+ wir
[~ this]
::
[%collection @t ~]
=/ col=@tas i.t.wir
=/ awa (~(get by awaiting.sat) col)
::
=/ dat=(each collection-info tang)
?: ?=([%incomplete *] mad)
[%.n tang.mad]
?: ?=([%error *] build-result.mad)
[%.n message.build-result.mad]
?> ?=(%bake +<.build-result.mad)
2019-07-12 01:07:05 +03:00
?> ?=(%publish-info p.cage.build-result.mad)
[%.y (collection-info q.q.cage.build-result.mad)]
::
?~ awa
(bake [%collection our.bol col dat])
=. builds.u.awa (~(del in builds.u.awa) wir)
?~ partial.u.awa
?~ builds.u.awa
:: one-off build, make delta and process it
::
=. awaiting.sat (~(del by awaiting.sat) col)
(bake [%collection our.bol col dat])
:: 1st part of multi-part, store partial delta and don't process it
::
2019-06-27 03:15:16 +03:00
=/ del=delta
:* %total our.bol col [ost.bol dat]
~ ~ [~ ~] [%white ~] ~ now.bol
==
=. awaiting.sat (~(put by awaiting.sat) col builds.u.awa `del)
[~ this]
::
?~ builds.u.awa
:: last part of multipart, update partial delta and process it
::
?> ?=(%total -.u.partial.u.awa)
=/ del=delta
:* %total
our.bol
col
2019-06-27 03:15:16 +03:00
[ost.bol dat]
pos.dat.u.partial.u.awa
com.dat.u.partial.u.awa
[~ ~]
2019-06-27 03:15:16 +03:00
[%white ~]
2019-06-21 23:24:33 +03:00
~
2019-06-27 03:15:16 +03:00
now.bol
==
=. awaiting.sat (~(del by awaiting.sat) col)
(bake del)
:: nth part of multi-part, update partial delta and don't process it
::
?> ?=(%total -.u.partial.u.awa)
=/ del=delta
:* %total
our.bol
col
2019-06-27 03:15:16 +03:00
[ost.bol dat]
pos.dat.u.partial.u.awa
com.dat.u.partial.u.awa
[~ ~]
2019-06-27 03:15:16 +03:00
[%white ~]
2019-06-21 23:24:33 +03:00
~
2019-06-27 03:15:16 +03:00
now.bol
==
=. awaiting.sat (~(put by awaiting.sat) col builds.u.awa `del)
[~ this]
::
[%post @t @t ~]
=/ col=@tas i.t.wir
=/ pos=@tas i.t.t.wir
=/ awa (~(get by awaiting.sat) col)
::
2019-06-17 21:39:53 +03:00
=/ dat=(each [post-info manx @t] tang)
?: ?=([%incomplete *] mad)
[%.n tang.mad]
?: ?=([%error *] build-result.mad)
[%.n message.build-result.mad]
?> ?=(%bake +<.build-result.mad)
2019-07-12 01:07:05 +03:00
?> ?=(%publish-post p.cage.build-result.mad)
2019-06-17 21:39:53 +03:00
[%.y (,[post-info manx @t] q.q.cage.build-result.mad)]
::
?~ awa
(bake [%post our.bol col pos dat])
=. builds.u.awa (~(del in builds.u.awa) wir)
?~ partial.u.awa
?~ builds.u.awa
:: one-off build, make delta and process it
::
=. awaiting.sat (~(del by awaiting.sat) col)
(bake [%post our.bol col pos dat])
:: 1st part of multi-part, store partial delta and don't process it
::
2019-06-21 23:24:33 +03:00
=/ del=delta
2019-06-27 03:15:16 +03:00
:* %total our.bol col [0 %.n ~] (my [pos ost.bol dat] ~)
~ [~ ~] [%white ~] ~ now.bol
==
=. awaiting.sat (~(put by awaiting.sat) col builds.u.awa `del)
[~ this]
::
?~ builds.u.awa
:: last part of multipart, update partial delta and process it
::
?> ?=(%total -.u.partial.u.awa)
=/ del=delta
:* %total
our.bol
col
col.dat.u.partial.u.awa
2019-06-27 03:15:16 +03:00
(~(put by pos.dat.u.partial.u.awa) pos [ost.bol dat])
com.dat.u.partial.u.awa
[~ ~]
2019-06-27 03:15:16 +03:00
[%white ~]
2019-06-21 23:24:33 +03:00
~
2019-06-27 03:15:16 +03:00
now.bol
==
=. awaiting.sat (~(del by awaiting.sat) col)
(bake del)
:: nth part of multi-part, update partial delta and don't process it
::
?> ?=(%total -.u.partial.u.awa)
=/ del=delta
:* %total
our.bol
col
col.dat.u.partial.u.awa
2019-06-27 03:15:16 +03:00
(~(put by pos.dat.u.partial.u.awa) pos [ost.bol dat])
com.dat.u.partial.u.awa
[~ ~]
2019-06-27 03:15:16 +03:00
[%white ~]
2019-06-21 23:24:33 +03:00
~
2019-06-27 03:15:16 +03:00
now.bol
==
=. awaiting.sat (~(put by awaiting.sat) col builds.u.awa `del)
[~ this]
::
[%comments @t @t ~]
=/ col=@tas i.t.wir
=/ pos=@tas i.t.t.wir
=/ awa (~(get by awaiting.sat) col)
::
2019-06-21 23:24:33 +03:00
=/ dat=(each (list [comment-info @t]) tang)
?: ?=([%incomplete *] mad)
[%.n tang.mad]
?: ?=([%error *] build-result.mad)
[%.n message.build-result.mad]
?> ?=(%bake +<.build-result.mad)
2019-07-12 01:07:05 +03:00
?> ?=(%publish-comments p.cage.build-result.mad)
2019-06-21 23:24:33 +03:00
[%.y (,(list [comment-info @t]) q.q.cage.build-result.mad)]
::
?~ awa
(bake [%comments our.bol col pos dat])
=. builds.u.awa (~(del in builds.u.awa) wir)
?~ partial.u.awa
?~ builds.u.awa
:: one-off build, make delta and process it
::
=. awaiting.sat (~(del by awaiting.sat) col)
(bake [%comments our.bol col pos dat])
:: 1st part of multi-part, store partial delta and don't process it
::
2019-06-21 23:24:33 +03:00
=/ del=delta
2019-06-27 03:15:16 +03:00
:* %total our.bol col [0 %.n ~] ~ (my [pos ost.bol dat] ~)
[~ ~] [%white ~] ~ now.bol
==
=. awaiting.sat (~(put by awaiting.sat) col builds.u.awa `del)
[~ this]
::
?~ builds.u.awa
:: last part of multipart, update partial delta and process it
::
?> ?=(%total -.u.partial.u.awa)
=/ del=delta
:* %total
our.bol
col
col.dat.u.partial.u.awa
pos.dat.u.partial.u.awa
2019-06-27 03:15:16 +03:00
(~(put by com.dat.u.partial.u.awa) pos [ost.bol dat])
[~ ~]
2019-06-27 03:15:16 +03:00
[%white ~]
2019-06-21 23:24:33 +03:00
~
2019-06-27 03:15:16 +03:00
now.bol
==
=. awaiting.sat (~(del by awaiting.sat) col)
(bake del)
:: nth part of multi-part, update partial delta and don't process it
::
?> ?=(%total -.u.partial.u.awa)
=/ del=delta
:* %total
our.bol
col
col.dat.u.partial.u.awa
pos.dat.u.partial.u.awa
2019-06-27 03:15:16 +03:00
(~(put by com.dat.u.partial.u.awa) pos [ost.bol dat])
[~ ~]
2019-06-27 03:15:16 +03:00
[%white ~]
2019-06-21 23:24:33 +03:00
~
2019-06-27 03:15:16 +03:00
now.bol
==
=. awaiting.sat (~(put by awaiting.sat) col builds.u.awa `del)
[~ this]
==
::
2019-06-27 03:15:16 +03:00
++ make-kills
|= [coll=@tas post=(unit @tas)]
^- (list move)
=/ col=(unit collection) (~(get by pubs.sat) coll)
?~ col
~| [%non-existent-collection coll] !!
?~ post
=/ kills=(list move)
%+ roll ~(tap by pos.u.col)
|= [[pos=@tas b=bone *] out=(list move)]
:* [b %kill /post/[coll]/[pos] ~]
[b %kill /comments/[coll]/[pos] ~]
out
==
[[bone.col.u.col %kill /collection/[coll] ~] kills]
::
=/ pos-bone bone:(~(got by pos.u.col) u.post)
=/ com-bone bone:(~(got by com.u.col) u.post)
:~ [pos-bone %kill /post/[coll]/[u.post] ~]
[com-bone %kill /comments/[coll]/[u.post] ~]
==
::
++ make-deletes
|= [coll=@tas post=(unit @tas)]
^- (list move)
=/ files=(list path)
?~ post
2019-07-12 01:07:05 +03:00
.^((list path) %ct (weld our-beak /web/publish/[coll]))
.^((list path) %ct (weld our-beak /web/publish/[coll]/[u.post]))
2019-06-27 03:15:16 +03:00
%+ turn files
|= pax=path
^- move
(delete-file pax)
::
++ mack
|= [wir=wire err=(unit tang)]
^- (quip move _this)
?~ err
[~ this]
%- (slog u.err)
[~ this]
::
2019-07-12 01:07:05 +03:00
++ poke-publish-action
|= act=action
^- (quip move _this)
?- -.act
::
%new-collection
2019-06-27 03:15:16 +03:00
?. =(our.bol src.bol)
:: no one else is permitted to create blogs
::
[~ this]
?: (~(has by pubs.sat) name.act)
[~ this]
::
=/ conf=collection-info
:* our.bol
title.act
name.act
com.act
edit.act
now.bol
now.bol
==
2019-07-12 01:07:05 +03:00
=/ pax=path /web/publish/[name.act]/publish-info
2019-06-27 03:15:16 +03:00
=/ blog-perms=card
:* %perm /perms q.byk.bol
2019-07-12 01:07:05 +03:00
/web/publish/[name.act]
2019-06-27 03:15:16 +03:00
%rw `read.perm.act `write.perm.act
==
=/ info-perms=card
:* %perm /perms q.byk.bol
2019-07-12 01:07:05 +03:00
/web/publish/[name.act]/publish-info
2019-06-27 03:15:16 +03:00
%rw `*rule:clay `*rule:clay
==
::
=/ wir=wire /collection/[name.act]
=/ schema=schematic:ford
:* %bake
2019-07-12 01:07:05 +03:00
%publish-info
*coin
2019-07-12 01:07:05 +03:00
[[our.bol q.byk.bol] /[name.act]/publish/web]
==
:_ this
2019-07-12 01:07:05 +03:00
:~ (write-file pax %publish-info !>(conf))
2019-06-27 03:15:16 +03:00
[ost.bol blog-perms]
[ost.bol info-perms]
[ost.bol %build wir %.y schema]
==
::
%new-post
2019-06-17 21:39:53 +03:00
?. =(who.act our.bol)
:_ this
2019-07-12 01:07:05 +03:00
[ost.bol %poke /forward [who.act %publish] %publish-action act]~
=/ pax=path /web/publish/[coll.act]/[name.act]/udon
2019-06-27 03:15:16 +03:00
?. (allowed src.bol %write pax)
[~ this]
=/ col=(unit collection) (~(get by pubs.sat) coll.act)
?~ col
[~ this]
?: (~(has by pos.u.col) name.act)
[~ this]
=. content.act (cat 3 content.act '\0a') :: XX fix udon parser
=/ front=(map knot cord)
%- my
:~ [%creator (scot %p src.bol)]
[%title title.act]
[%collection coll.act]
[%filename name.act]
[%comments com.act]
[%date-created (scot %da now.bol)]
[%last-modified (scot %da now.bol)]
[%pinned %false]
==
2019-06-27 03:15:16 +03:00
=/ out=@t (update-udon-front front content.act)
::
=/ post-wir=wire /post/[coll.act]/[name.act]
=/ post-schema=schematic:ford
:* %bake
2019-07-12 01:07:05 +03:00
%publish-post
*coin
2019-07-12 01:07:05 +03:00
[[our.bol q.byk.bol] /[name.act]/[coll.act]/publish/web]
==
::
=/ comments-wir=wire /comments/[coll.act]/[name.act]
=/ comments-schema=schematic:ford
:* %bake
2019-07-12 01:07:05 +03:00
%publish-comments
*coin
2019-07-12 01:07:05 +03:00
[[our.bol q.byk.bol] /[name.act]/[coll.act]/publish/web]
==
2019-06-27 03:15:16 +03:00
::
=/ post-perms=card
:* %perm /perms q.byk.bol
2019-07-12 01:07:05 +03:00
/web/publish/[coll.act]/[name.act]/udon
2019-06-27 03:15:16 +03:00
%w `[%white (ships-to-whom (sy src.bol ~))]
==
=/ comment-perms=card
:* %perm /perms q.byk.bol
2019-07-12 01:07:05 +03:00
/web/publish/[coll.act]/[name.act]
2019-06-27 03:15:16 +03:00
%w `[%black ~]
==
:_ this
:~ (write-file pax %udon !>(out))
2019-06-27 03:15:16 +03:00
[ost.bol post-perms]
[ost.bol comment-perms]
[ost.bol %build comments-wir %.y comments-schema]
[ost.bol %build post-wir %.y post-schema]
==
::
%new-comment
2019-06-17 21:39:53 +03:00
?. =(who.act our.bol)
:_ this
2019-07-12 01:07:05 +03:00
[ost.bol %poke /forward [who.act %publish] %publish-action act]~
2019-07-12 01:20:29 +03:00
=/ pax=path
/web/publish/[coll.act]/[post.act]/(scot %da now.bol)/publish-comment
2019-06-27 03:15:16 +03:00
?. (allowed src.bol %write pax)
[~ this]
=/ col=(unit collection) (~(get by pubs.sat) coll.act)
?~ col
[~ this]
?. (~(has by pos.u.col) post.act)
[~ this]
2019-07-11 21:32:30 +03:00
=/ com=comment
[[src.bol coll.act post.act now.bol now.bol] content.act]
2019-06-27 03:15:16 +03:00
::
=/ comment-perms=card
:* %perm /perms q.byk.bol pax
%w `[%white ~]
==
::
:_ this
2019-07-12 01:07:05 +03:00
:~ (write-file pax %publish-comment !>(com))
2019-06-27 03:15:16 +03:00
[ost.bol comment-perms]
==
::
2019-06-21 23:24:33 +03:00
%delete-collection
2019-06-27 03:15:16 +03:00
?. =(src.bol our.bol)
[~ this]
=/ kills (make-kills coll.act ~)
=/ deletes (make-deletes coll.act ~)
=/ del=delta [%remove our.bol coll.act ~]
=^ moves this (bake del)
::
:-
;: welp
kills
moves
make-tile-moves
deletes
==
%= this
awaiting.sat (~(del by awaiting.sat) coll.act)
==
2019-06-21 23:24:33 +03:00
::
%delete-post
2019-06-27 03:15:16 +03:00
?. =(src.bol our.bol)
[~ this]
=/ kills (make-kills coll.act `post.act)
=/ deletes (make-deletes coll.act `post.act)
=/ del=delta [%remove our.bol coll.act `post.act]
=^ moves this (bake del)
::
:_ this
;: welp
kills
moves
make-tile-moves
deletes
==
2019-06-21 23:24:33 +03:00
::
%delete-comment
2019-06-27 03:15:16 +03:00
?. =(src.bol our.bol)
[~ this]
:_ this
2019-07-12 01:07:05 +03:00
[(delete-file /web/publish/[coll.act]/[post.act]/[comment.act]/udon)]~
::
%edit-collection
2019-06-27 03:15:16 +03:00
?. =(src.bol our.bol)
[~ this]
2019-07-19 01:34:42 +03:00
=/ pax=path /web/publish/[name.act]/publish-info
=/ col=(unit collection) (~(get by pubs.sat) name.act)
?~ col
[~ this]
?: ?=(%.n -.dat.col.u.col)
[~ this]
=/ out=collection-info p.dat.col.u.col(title title.act)
:_ this
[(write-file pax %publish-info !>(out))]~
::
%edit-post
2019-06-17 21:39:53 +03:00
?. =(who.act our.bol)
:_ this
2019-07-12 01:07:05 +03:00
[ost.bol %poke /forward [who.act %publish] %publish-action act]~
2019-06-17 21:39:53 +03:00
::
2019-07-12 01:07:05 +03:00
=/ pax=path /web/publish/[coll.act]/[name.act]/udon
2019-06-27 03:15:16 +03:00
?. (allowed src.bol %write pax)
[~ this]
=/ col=(unit collection) (~(get by pubs.sat) coll.act)
?~ col
[~ this]
?. (~(has by pos.u.col) name.act)
[~ this]
::
2019-07-11 21:32:30 +03:00
=/ pos=(unit (each [post-info manx @t] tang))
(get-post-by-index who.act coll.act name.act)
2019-06-17 21:39:53 +03:00
?~ pos
~| %editing-non-existent-post !!
2019-07-11 21:32:30 +03:00
=/ date-created=@da
?: ?=(%.y -.u.pos)
date-created.-.p.u.pos
now.bol
2019-06-17 21:39:53 +03:00
::
=. content.act (cat 3 content.act '\0a') :: XX fix udon parser
=/ front=(map knot cord)
%- my
:~ [%creator (scot %p src.bol)]
[%title title.act]
[%collection coll.act]
[%filename name.act]
[%comments com.act]
2019-07-11 21:32:30 +03:00
[%date-created (scot %da date-created)]
2019-06-17 21:39:53 +03:00
[%last-modified (scot %da now.bol)]
2019-07-11 21:32:30 +03:00
[%pinned %false]
2019-06-17 21:39:53 +03:00
==
2019-06-27 03:15:16 +03:00
=/ out=@t (update-udon-front front content.act)
2019-06-17 21:39:53 +03:00
::
:_ this
[(write-file pax %udon !>(out))]~
::
2019-06-21 23:24:33 +03:00
:: %invite: if the action is from us it means send invites to other people
:: if its from someone else it means we've been invited
::
%invite
2019-06-21 23:24:33 +03:00
?: =(our.bol src.bol)
=/ new-act=action [%invite coll.act title.act ~]
:_ this
%+ turn who.act
|= who=@p
^- move
2019-07-12 01:07:05 +03:00
[ost.bol %poke /forward [who %publish] %publish-action new-act]
2019-06-21 23:24:33 +03:00
=. invites.sat (~(put by invites.sat) [src.bol coll.act] title.act)
:_ this
%+ welp make-tile-moves
::
%+ turn (prey:pubsub:userlib /primary bol)
|= [b=bone *]
2019-07-12 01:07:05 +03:00
[b %diff %publish-update %invite %.y src.bol coll.act title.act]
2019-06-21 23:24:33 +03:00
::
:: %reject-invite: remove invite from list, acceptance is handled by
:: %subscribe action
::
%reject-invite
=/ title=(unit @t) (~(get by invites.sat) [who.act coll.act])
?~ title
[~ this]
=. invites.sat (~(del by invites.sat) [who.act coll.act])
:_ this
%+ welp make-tile-moves
::
%+ turn (prey:pubsub:userlib /primary bol)
|= [b=bone *]
^- move
2019-07-12 01:07:05 +03:00
[b %diff %publish-update %invite %.n who.act coll.act u.title]
::
:: %serve:
::
%serve
:: XX specialize this check for subfiles
?: (~(has by pubs.sat) coll.act)
[~ this]
=/ files=(list path)
2019-07-12 01:07:05 +03:00
.^((list path) %ct (weld our-beak /web/publish/[coll.act]))
=/ all=[moves=(list move) builds=(set wire)]
%+ roll files
|= [pax=path out=[moves=(list move) builds=(set wire)]]
?+ pax
out
::
2019-07-12 01:07:05 +03:00
[%web %publish @tas %publish-info ~]
?> =(coll.act i.t.t.pax)
=/ wir=wire /collection/[coll.act]
=/ schema=schematic:ford
:* %bake
2019-07-12 01:07:05 +03:00
%publish-info
*coin
2019-07-12 01:07:05 +03:00
[[our.bol q.byk.bol] /[coll.act]/publish/web]
==
%= out
moves [[ost.bol %build wir %.y schema] moves.out]
builds (~(put in builds.out) wir)
==
::
2019-07-12 01:07:05 +03:00
[%web %publish @tas @tas %udon ~]
?> =(coll.act i.t.t.pax)
=/ post i.t.t.t.pax
=/ post-wir=wire /post/[coll.act]/[post]
=/ post-schema=schematic:ford
:* %bake
2019-07-12 01:07:05 +03:00
%publish-post
*coin
2019-07-12 01:07:05 +03:00
[[our.bol q.byk.bol] /[post]/[coll.act]/publish/web]
==
::
=/ comments-wir=wire /comments/[coll.act]/[post]
=/ comments-schema=schematic:ford
:* %bake
2019-07-12 01:07:05 +03:00
%publish-comments
*coin
2019-07-12 01:07:05 +03:00
[[our.bol q.byk.bol] /[post]/[coll.act]/publish/web]
==
%= out
moves
:* [ost.bol %build post-wir %.y post-schema]
[ost.bol %build comments-wir %.y comments-schema]
moves.out
==
::
builds
(~(uni in builds.out) (sy post-wir comments-wir ~))
==
::
==
:- moves.all
%= this
awaiting.sat (~(put by awaiting.sat) coll.act builds.all ~)
==
::
:: %unserve:
::
%unserve
:: XX pull subscriptions for unserved collections
::
2019-06-27 03:15:16 +03:00
?. =(our.bol src.bol)
[~ this]
=/ kills (make-kills coll.act ~)
=/ del=delta [%remove our.bol coll.act ~]
=^ moves this (bake del)
::
2019-06-27 03:15:16 +03:00
:-
;: welp
moves
2019-06-21 23:24:33 +03:00
make-tile-moves
2019-06-27 03:15:16 +03:00
kills
==
%= this
awaiting.sat (~(del by awaiting.sat) coll.act)
==
::
2019-06-21 23:24:33 +03:00
:: %subscribe: sub to a foreign blog; remove invites for that blog
::
%subscribe
=/ wir=wire /collection/[coll.act]
2019-06-21 23:24:33 +03:00
=/ title=(unit @t) (~(get by invites.sat) [who.act coll.act])
=. invites.sat (~(del by invites.sat) [who.act coll.act])
2019-06-27 03:15:16 +03:00
:_ this(outgoing.sat (~(put by outgoing.sat) wir ost.bol))
;: welp
2019-06-21 23:24:33 +03:00
make-tile-moves
2019-07-12 01:07:05 +03:00
[ost.bol %peer wir [who.act %publish] wir]~
2019-06-21 23:24:33 +03:00
?~ title ~
%+ turn (prey:pubsub:userlib /primary bol)
|= [b=bone *]
^- move
2019-07-12 01:07:05 +03:00
[b %diff %publish-update %invite %.n who.act coll.act u.title]
2019-06-21 23:24:33 +03:00
==
::
2019-06-21 23:24:33 +03:00
:: %unsubscribe: unsub from a foreign blog, delete all state related to it
::
%unsubscribe
2019-06-27 03:15:16 +03:00
=/ wir=wire /collection/[coll.act]
=/ bon=(unit bone) (~(get by outgoing.sat) wir)
?~ bon
~| %nonexistent-subscription^wir !!
=/ new-latest=(list [@p @tas @tas])
%+ skim latest.sat
|= [who=@p coll=@tas post=@tas]
?& =(who our.bol)
=(coll coll.act)
==
::
2019-06-21 23:24:33 +03:00
=. unread.sat
^- (set [@p @tas @tas])
%- sy
%+ skim ~(tap in unread.sat)
|= [who=@p coll=@tas post=@tas]
?& =(who our.bol)
=(coll coll.act)
==
2019-06-21 23:24:33 +03:00
:_ %= this
2019-06-27 03:15:16 +03:00
subs.sat (~(del by subs.sat) who.act coll.act)
latest.sat new-latest
outgoing.sat (~(del by outgoing.sat) wir)
==
2019-07-12 01:07:05 +03:00
:- [u.bon %pull wir [who.act %publish] ~]
2019-06-21 23:24:33 +03:00
%+ welp make-tile-moves
%+ turn (prey:pubsub:userlib /primary bol)
|= [b=bone *]
^- move
2019-07-12 01:07:05 +03:00
[b %diff %publish-rumor %remove who.act coll.act ~]
2019-06-21 23:24:33 +03:00
::
:: %read: notify that we've seen a post
::
%read
=. unread.sat (~(del in unread.sat) who.act coll.act post.act)
[make-tile-moves this]
::
==
::
++ bound
|= [wir=wire success=? binding=binding:eyre]
^- (quip move _this)
[~ this]
::
:: +poke-handle-http-request: received on a new connection established
::
++ poke-handle-http-request
%- (require-authorization:app ost.bol move this)
|= =inbound-request:eyre
^- (quip move _this)
::
=/ request-line (parse-request-line url.request.inbound-request)
?+ request-line
:_ this
[ost.bol %http-response not-found:app]~
2019-06-21 23:24:33 +03:00
:: images
::
[[[~ %png] [%'~publish' @t ~]] ~]
=/ filename=@t i.t.site.request-line
=/ img=(unit @t) (~(get by images) filename)
?~ img
:_ this
[ost.bol %http-response not-found:app]~
:_ this
[ost.bol %http-response (png-response:app (as-octs:mimes:html u.img))]~
:: styling
::
[[[~ %css] [%'~publish' %index ~]] ~]
:_ this
[ost.bol %http-response (css-response:app css)]~
:: scripting
::
[[[~ %js] [%'~publish' %index ~]] ~]
:_ this
[ost.bol %http-response (js-response:app js)]~
2019-06-21 23:24:33 +03:00
:: tile js
::
[[[~ %js] [%'~publish' %tile ~]] ~]
:_ this
[ost.bol %http-response (js-response:app tile-js)]~
:: home page; redirect to recent
::
[[~ [%'~publish' ~]] ~]
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (redirect:app '/~publish/recent')]~
:: recent page
::
[[~ [%'~publish' %recent ~]] ~]
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
:: subscriptions
::
[[~ [%'~publish' %subs ~]] ~]
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
:: published
::
[[~ [%'~publish' %pubs ~]] ~]
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
2019-06-17 21:39:53 +03:00
:: new post
::
2019-07-11 21:32:30 +03:00
[[~ [%'~publish' %new-post ~]] ~]
2019-06-17 21:39:53 +03:00
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
:: new blog
::
2019-07-11 21:32:30 +03:00
[[~ [%'~publish' %new-blog ~]] ~]
2019-06-17 21:39:53 +03:00
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
:: blog
::
[[~ [%'~publish' @t @t ~]] ~]
=/ who=(unit @p) (slaw %p i.t.site.request-line)
=/ blog=@tas i.t.t.site.request-line
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
:: blog post
::
[[~ [%'~publish' @t @t @t ~]] ~]
=/ who=(unit @p) (slaw %p i.t.site.request-line)
=/ blog=@tas i.t.t.site.request-line
=/ post=@tas i.t.t.t.site.request-line
::
=/ hym=manx (index (state-to-json sat))
:_ this
[ost.bol %http-response (manx-response:app hym)]~
::
==
::
2019-06-21 23:24:33 +03:00
++ make-tile-moves
^- (list move)
%+ turn (prey:pubsub:userlib /publishtile bol)
|= [b=bone *]
^- move
[b %diff %json make-tile-json]
::
++ make-tile-json
^- json
%- pairs:enjs:format
:~ invites+(numb:enjs:format ~(wyt by invites.sat))
new+(numb:enjs:format ~(wyt in unread.sat))
==
::
++ peer-publishtile
|= wir=wire
^- (quip move _this)
:_ this
[ost.bol %diff %json make-tile-json]~
::
++ peer-primary
|= wir=wire
^- (quip move _this)
?. =(our.bol src.bol)
:: only we are allowed to subscribe on primary
::
:_ this
[ost.bol %quit ~]~
[~ this]
::
++ pull
|= wir=wire
^- (quip move _this)
2019-06-27 03:15:16 +03:00
?+ wir
[~ this]
::
[%collection @t ~]
=/ coll=@tas i.t.wir
=/ col=(unit collection) (~(get by pubs.sat) coll)
?~ col
[~ this]
=/ new=collection
u.col(subscribers (~(del in subscribers.u.col) src.bol))
[~ this(pubs.sat (~(put by pubs.sat) coll new))]
::
==
::
++ peer-collection
|= wir=wire
^- (quip move _this)
?. ?=([@tas ~] wir)
[~ this]
=/ coll=@tas i.wir
2019-07-12 01:07:05 +03:00
=/ pax /web/publish/[coll]
2019-06-27 03:15:16 +03:00
?. (allowed src.bol %read pax)
:_ this
[ost.bol %quit ~]~
::
=/ col=(unit collection) (~(get by pubs.sat) coll)
?~ col
2019-06-27 03:15:16 +03:00
:_ this
[ost.bol %quit ~]~
=/ new=collection
u.col(subscribers (~(put in subscribers.u.col) src.bol))
=/ rum=rumor
2019-06-27 03:15:16 +03:00
[%total our.bol coll new]
:_ this(pubs.sat (~(put by pubs.sat) coll new))
2019-07-12 01:07:05 +03:00
[ost.bol %diff %publish-rumor rum]~
::
2019-07-12 01:07:05 +03:00
++ diff-publish-rumor
|= [wir=wire rum=rumor]
^- (quip move _this)
(bake rum)
:: +poke-handle-http-cancel: received when a connection was killed
::
++ poke-handle-http-cancel
|= =inbound-request:eyre
^- (quip move _this)
[~ this]
::
--