chat-hook: send right amount of backlog

This commit is contained in:
Isaac Visintainer 2020-12-08 19:51:28 -08:00
parent b1eed3a0e0
commit c5ccc1171a

View File

@ -690,13 +690,14 @@
=/ length (lent envs) =/ length (lent envs)
=/ latest =/ latest
?~ backlog-latest length ?~ backlog-latest length
?: (gth u.backlog-latest length) length ?: (gth u.backlog-latest length) 0
(sub length u.backlog-latest) (sub length u.backlog-latest)
=. envs (scag latest envs) =. envs (scag latest envs)
=/ =vase !>([%messages pas 0 latest envs]) =/ =vase !>([%messages pas 0 latest envs])
%- zing %- zing
:~ [%give %fact ~ %chat-update !>([%create pas])]~ :~ [%give %fact ~ %chat-update !>([%create pas])]~
?. ?&(?=(^ backlog-latest) (~(has by allow-history) pas)) ~ ?. ?&(?=(^ backlog-latest) (~(has by allow-history) pas)) ~
?: =(0 latest) ~
[%give %fact ~ %chat-update vase]~ [%give %fact ~ %chat-update vase]~
[%give %kick [%backlog pax]~ `src.bol]~ [%give %kick [%backlog pax]~ `src.bol]~
== ==