chat-hook: get backlog on resubscribe

This commit is contained in:
Philip Monk 2019-11-30 21:24:23 -08:00
parent 077bad8c4d
commit 7d68a2e811
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC

View File

@ -384,14 +384,19 @@
?: =(wir /permissions)
:_ state
[%pass /permissions %agent [our.bol %permission-store] %watch /updates]~
::
?: ?=([%mailbox @ *] wir)
~& mailbox-kick+wir
?. (~(has by synced) t.wir)
:: no-op
[~ state]
~& %chat-hook-resubscribe
:: TODO: only ask for backlog from previous point
=/ =ship (~(got by synced) t.wir)
=/ chat-history (welp backlog+t.wir /0)
:_ state
[%pass wir %agent [(slav %p i.t.wir) %chat-hook] %watch wir]~
[%pass chat-history %agent [ship %chat-hook] %watch chat-history]~
::
?: ?=([%backlog @ *] wir)
~& backlog-kick+wir
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)