From 7d68a2e81105ff98bac17514ed9d4002d0631de1 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Sat, 30 Nov 2019 21:24:23 -0800 Subject: [PATCH] chat-hook: get backlog on resubscribe --- pkg/arvo/app/chat-hook.hoon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon index 38c801222..84ae851b0 100644 --- a/pkg/arvo/app/chat-hook.hoon +++ b/pkg/arvo/app/chat-hook.hoon @@ -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)