chat-hook: clarify backlog wire handling logic

This commit is contained in:
Fang 2020-04-16 01:44:36 +02:00
parent 0f05ed3149
commit 4c4858f198
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -583,15 +583,15 @@
[%pass chat-history %agent [ship %chat-hook] %watch chat-history]~
::
[%backlog @ @ *]
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
?. (~(has by synced) pax) [~ state]
=/ chat=path (oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
?. (~(has by synced) chat) [~ state]
=/ =ship
?: =('~' i.t.wir)
(slav %p i.t.t.wir)
(slav %p i.t.wir)
=. pax ?~((chat-scry pax) wir [%mailbox pax])
=/ =path ?~((chat-scry chat) wir [%mailbox chat])
:_ state
[%pass pax %agent [ship %chat-hook] %watch pax]~
[%pass path %agent [ship %chat-hook] %watch path]~
==
::
++ watch-ack
@ -603,10 +603,10 @@
(poke-chat-hook-action %remove t.wir)
::
[%backlog @ @ @ *]
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
%. (poke-chat-hook-action %remove pax)
=/ chat=path (oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
%. (poke-chat-hook-action %remove chat)
%- slog
:* leaf+"chat-hook failed subscribe on {(spud pax)}"
:* leaf+"chat-hook failed subscribe on {(spud chat)}"
leaf+"stack trace:"
u.saw
==