From 0e04242148c315c962302554c47972681563c3bb Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 11 Dec 2017 00:53:39 +0100 Subject: [PATCH] Add logic for rebuilding state that refers to messages by numbers. Because count used to be incorrect, messages are being referred to by incorrect indices. This rebuilds all count-dependent data. --- app/hall.hoon | 15 ++++++++++++--- app/talk.hoon | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/hall.hoon b/app/hall.hoon index 8fe73f0e0..9d7585443 100644 --- a/app/hall.hoon +++ b/app/hall.hoon @@ -123,9 +123,18 @@ %- pre-bake ta-done:ta-init:ta =. stories.u.old - %- ~(run by stories.u.old) - |= s/story - s(count (lent grams.s)) + %- ~(urn by stories.u.old) + |= {nom/naem soy/story} + =+ %+ roll grams.soy + |= {t/telegram c/@ud k/(map serial @ud) s/(map circle (list @ud))} + :+ +(c) (~(put by k) uid.t c) + =/ src/circle + ?: (~(has by aud.t) [our.bol nom]) [our.bol nom] + ?~ aud.t ~&(%strange-aud [our.bol %inbox]) + n.aud.t + %+ ~(put by s) src + [c (fall (~(get by s) src) ~)] + soy(count c, known k, sourced s) [~ ..prep(+<+ u.old)] :: ::> || diff --git a/app/talk.hoon b/app/talk.hoon index 946a50d05..8754b75c9 100644 --- a/app/talk.hoon +++ b/app/talk.hoon @@ -118,6 +118,12 @@ ^- (quip move _..prep) ?~ old ta-done:ta-init:ta + =* o u.old + =. count.o (lent grams.o) + =+ %+ reel grams.o + |= {t/telegram c/@ud k/(map serial @ud)} + [+(c) (~(put by k) uid.t c)] + =. known.o k [~ ..prep(+<+ u.old)] :: ::> ||