diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon index 68e32b493..d62668ae6 100644 --- a/pkg/arvo/app/chat-hook.hoon +++ b/pkg/arvo/app/chat-hook.hoon @@ -400,16 +400,14 @@ ?> ?=(^ pax) =/ last (dec (lent pax)) =/ backlog-start=(unit @ud) - %+ rush - (snag last `(list @ta)`pax) - dem:ag + (rush (snag last `(list @ta)`pax) dem:ag) =/ pas `path`(oust [last 1] `(list @ta)`pax) ?> ?=([* ^] pas) ?> (~(has by synced) pas) :: check if read is permitted ?> (is-permitted src.bol pas) - =/ =mailbox (need (chat-scry pas)) - =* envs envelopes.mailbox + =/ backlog-limit 10.000 + =/ envs (scag backlog-limit envelopes:(need (chat-scry pas))) %- zing :~ [%give %fact ~ %chat-update !>([%create pas])]~ ?. ?&(?=(^ backlog-start) (~(has by allow-history) pas)) ~ diff --git a/pkg/arvo/app/chat-view.hoon b/pkg/arvo/app/chat-view.hoon index 7c3769b1e..a967f791b 100644 --- a/pkg/arvo/app/chat-view.hoon +++ b/pkg/arvo/app/chat-view.hoon @@ -121,14 +121,7 @@ %- ~(run by inbox) |= =mailbox ^- ^mailbox - [config.mailbox (truncate-envelopes envelopes.mailbox)] - :: - ++ truncate-envelopes - |= envelopes=(list envelope) - ^- (list envelope) - ?: (lth (lent envelopes) message-limit) - envelopes - (scag message-limit envelopes) + [config.mailbox (scag message-limit envelopes.mailbox)] -- :: ++ on-agent