diff --git a/app/talk.hoon b/app/talk.hoon index 8ecc9a223..d6553ce88 100644 --- a/app/talk.hoon +++ b/app/talk.hoon @@ -29,9 +29,10 @@ |% ++ state :> application state $: :: messaging state :: - count/@ud :< (lent grams) grams/(list telegram) :< all history known/(map serial @ud) :< messages heard + last/@ud :< last heard + count/@ud :< (lent grams) sources/(set circle) :< our subscriptions :: circle details :: remotes/(map circle group) :< remote presences @@ -226,7 +227,10 @@ server :: %+ welp /circle/[inbox]/grams/config/group - ?:(=(0 count) ~ [(scot %ud count) ~]) + ?. =(0 count) + [(scot %ud last) ~] + =+ history-days=~d5 + [(scot %da (sub now.bol history-days)) ~] == :: :> # @@ -367,7 +371,7 @@ ~&([%unexpected-circle-rumor -.rum] +>) :: $gram - (ta-learn gam.nev.rum) + (ta-open nev.rum) :: $config =+ cur=(fall (~(get by mirrors) cir.rum) *config) @@ -453,15 +457,16 @@ :: |= nes/(list envelope) ^+ +> - (ta-lesson (turn nes tail)) + ?~ nes +> + $(nes t.nes, +> (ta-open i.nes)) :: - ++ ta-lesson - :> learn all telegrams in a list. + ++ ta-open + :> learn message from an envelope. :: - |= gaz/(list telegram) + |= nev/envelope ^+ +> - ?~ gaz +> - $(gaz t.gaz, +> (ta-learn i.gaz)) + =? last (gth num.nev last) num.nev + (ta-learn gam.nev) :: ++ ta-learn :> save/update message @@ -2458,7 +2463,7 @@ == ?: =(a 'reset') ~& 'full reset incoming, hold on to your cli...' - :_ +>(grams ~, known ~, count 0) + :_ +>(grams ~, known ~, count 0, last 0) :~ [ost.bol %pull /server/client server ~] [ost.bol %pull /server/inbox server ~] peer-client