From f5628c1dad7ec9f669e2b354bcf1dd9f9d7d291c Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 5 Jan 2018 20:19:34 +0100 Subject: [PATCH] Separate the Tlon ops generators to allow more granular control over stream & fora sources. --- app/hood.hoon | 3 ++- gen/hood/tlon/add-fora.hoon | 11 +++++++++++ gen/hood/tlon/add-stream.hoon | 2 ++ gen/hood/tlon/init-stream.hoon | 12 ++++++++++++ gen/hood/tlon/init-web.hoon | 9 --------- lib/hood/helm.hoon | 24 ++++++++++++++++++++---- 6 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 gen/hood/tlon/add-fora.hoon create mode 100644 gen/hood/tlon/init-stream.hoon delete mode 100644 gen/hood/tlon/init-web.hoon diff --git a/app/hood.hoon b/app/hood.hoon index 5e6e3a8692..a729cb3828 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -164,8 +164,9 @@ ++ poke-helm-nuke (wrap poke-nuke):from-helm ++ poke-helm-begin (wrap poke-begin):from-helm ++ poke-helm-spawn (wrap poke-spawn):from-helm +++ poke-helm-tlon-add-fora (wrap poke-tlon-add-fora):from-helm ++ poke-helm-tlon-add-stream (wrap poke-tlon-add-stream):from-helm -++ poke-helm-tlon-init-web (wrap poke-tlon-init-web):from-helm +++ poke-helm-tlon-init-stream (wrap poke-tlon-init-stream):from-helm ++ poke-hood-sync (wrap poke-sync):from-kiln ++ poke-hood-init-sync (wrap poke-init-sync):from-kiln ++ poke-kiln-commit (wrap poke-commit):from-kiln diff --git a/gen/hood/tlon/add-fora.hoon b/gen/hood/tlon/add-fora.hoon new file mode 100644 index 0000000000..2ce32b8fbd --- /dev/null +++ b/gen/hood/tlon/add-fora.hoon @@ -0,0 +1,11 @@ +:: tlon: add fora notifications to local urbit-meta +:: +:: make the local urbit-meta pull from {for}'s fora notification channels. +:: +:::: /gen/hood/tlon/add-fora/hoon + :: +:- %say +|= $: {now/@da eny/@uvJ bec/beak} + {{for/ship $~} $~} + == +[%helm-tlon-add-fora for] diff --git a/gen/hood/tlon/add-stream.hoon b/gen/hood/tlon/add-stream.hoon index 5bb1109987..dbc29448dd 100644 --- a/gen/hood/tlon/add-stream.hoon +++ b/gen/hood/tlon/add-stream.hoon @@ -1,5 +1,7 @@ :: tlon: add stream to local urbit-meta :: +:: make the local urbit-meta pull from {web}'s stream. +:: :::: /gen/hood/tlon/add-stream/hoon :: :- %say diff --git a/gen/hood/tlon/init-stream.hoon b/gen/hood/tlon/init-stream.hoon new file mode 100644 index 0000000000..3d1be720d0 --- /dev/null +++ b/gen/hood/tlon/init-stream.hoon @@ -0,0 +1,12 @@ +:: tlon: configure stream ship +:: +:: create a local stream channel and have it pull from +:: {met}'s urbit-meta. +:: +:::: /gen/hood/tlon/init-stream/hoon + :: +:- %say +|= $: {now/@da eny/@uvJ bec/beak} + {{met/ship $~} $~} + == +[%helm-tlon-init-stream met] diff --git a/gen/hood/tlon/init-web.hoon b/gen/hood/tlon/init-web.hoon deleted file mode 100644 index 8cf44c1f7a..0000000000 --- a/gen/hood/tlon/init-web.hoon +++ /dev/null @@ -1,9 +0,0 @@ -:: tlon: configure web ship -:: -:::: /gen/hood/tlon/init-web/hoon - :: -:- %say -|= $: {now/@da eny/@uvJ bec/beak} - {{met/ship $~} $~} - == -[%helm-tlon-init-web met] diff --git a/lib/hood/helm.hoon b/lib/hood/helm.hoon index fd5e3584ed..1275471844 100644 --- a/lib/hood/helm.hoon +++ b/lib/hood/helm.hoon @@ -241,14 +241,13 @@ |= {way/wire her/ship cop/coop} =< abet (emit %flog ~ %text "woot: {<[way cop]>}") :: -++ poke-tlon-init-web +++ poke-tlon-init-stream + :: creates stream channel and makes it pull from + :: urbit-meta on {met}. |= met/ship =< abet %- emil %- flop :~ ^- card - :^ %poke /helm/web/fora [our %hood] - [%drum-start q.byk %fora] - :: :^ %poke /helm/web/stream/create [our %hall] :- %hall-action :- %create @@ -265,7 +264,24 @@ [%stream & [[[met %urbit-meta] `[da+(sub now ~d1) ~]] ~ ~]] == :: +++ poke-tlon-add-fora + :: makes the local urbit-meta pull from {for}'s fora + :: notification channels. + |= for/ship =< abet + %- emil + :~ :^ %poke /helm/web/fora/source [our %hall] + :- %hall-action + :- %source + [%urbit-meta & [[[for %fora-posts] `[da+now ~]] ~ ~]] + :: + :^ %poke /helm/web/fora/source [our %hall] + :- %hall-action + :- %source + [%urbit-meta & [[[for %fora-comments] `[da+now ~]] ~ ~]] + == +:: ++ poke-tlon-add-stream + :: makes the local urbit-meta pull from {web}'s stream. |= web/ship =< abet %- emit :^ %poke /helm/web/stream/source [our %hall]