From 49dc81f7d18158e111cea020ede13469d74c0c98 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 24 Jul 2020 15:50:21 -0700 Subject: [PATCH] chat-hook: append messages to new dm --- pkg/arvo/app/chat-hook.hoon | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon index 370a716ed..a2ccebd6d 100644 --- a/pkg/arvo/app/chat-hook.hoon +++ b/pkg/arvo/app/chat-hook.hoon @@ -399,10 +399,16 @@ ~ =/ =ship (slav %p i.t.path) ?: =(ship our.bol) + :: local dm, no need to do cleanup + ~ + ?: ?=(^ (groups-of-chat path)) + :: correctly initialized, no need to do cleanup + :: ~ :- =- [%pass /fixdm %agent [our.bol %chat-view] %poke %chat-view-action -] !> ^- action:store [%delete path] + =/ new-dm /(scot %p our.bol)/(crip (weld "dm--" (trip (scot %p ship)))) =/ mailbox=(unit mailbox:store) (chat-scry path) ?~ mailbox ~ @@ -412,8 +418,8 @@ %- crip (zing [(trip (scot %p our.bol)) " <-> " (trip (scot %p ship)) ~]) '' - /(scot %p our.bol)/(crip (weld "dm--" (trip (scot %p ship)))) - /(scot %p our.bol)/(crip (weld "dm--" (trip (scot %p ship)))) + new-dm + new-dm [%invite (silt ~[ship])] (silt ~[ship]) %.y @@ -422,7 +428,7 @@ :: =- [%pass /fixdm %agent [our.bol %chat-store] %poke %chat-action -] !> ^- action:store - [%messages envelopes.u.mailbox] + [%messages new-dm envelopes.u.mailbox] == :: ++ poke-json