mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
chat-view and hook: style pass and backlog truncation
This commit is contained in:
parent
ecc8942eaf
commit
8cdfb559f6
@ -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)) ~
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user