From c45dcd68255404da844f9b2c4b35c85d48da6866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 17 Jan 2026 16:33:11 +0100 Subject: Accept invites via shared state --- main/Main.hs | 3 +-- main/Test.hs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'main') diff --git a/main/Main.hs b/main/Main.hs index 227451f..ec8c98a 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -992,8 +992,7 @@ cmdInviteAccept = do , Just from <- readRefDigest $ T.encodeUtf8 $ "blake2#" <> tfrom , Just token <- parseInviteToken tinv -> do - server <- asks ciServer - acceptInvite server from token + acceptInvite from token _ -> throwOtherError "invalit invite URL" cmdConversations :: Command diff --git a/main/Test.hs b/main/Test.hs index 7fdf5fc..5b6509a 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -239,9 +239,9 @@ inviteAttributes out = (defaultServiceAttributes Proxy) pid <- asks svcPeerIdentity afterCommit $ outLine out $ "invite-accepted " <> maybe "" showInviteToken inviteToken <> " " <> (BC.unpack $ showRef $ storedRef $ idExtData pid) , inviteHookReplyContact = \token _ -> do - afterCommit $ outLine out $ "invite-accept-done " <> showInviteToken token <> " contact" + afterCommit $ outLine out $ "invite-reply " <> showInviteToken token <> " contact" , inviteHookReplyInvalid = \token -> do - afterCommit $ outLine out $ "invite-accept-done " <> showInviteToken token <> " invalid" + afterCommit $ outLine out $ "invite-reply " <> showInviteToken token <> " invalid" } dmThreadWatcher :: ComposedIdentity -> Output -> DirectMessageThread -> DirectMessageThread -> IO () @@ -1091,5 +1091,5 @@ cmdInviteAccept = do [ tokenText, idref ] <- asks tiParams Just token <- return $ parseInviteToken tokenText Just from <- return $ readRefDigest $ encodeUtf8 idref - Just RunningServer {..} <- gets tsServer - acceptInvite rsServer from token + acceptInvite from token + cmdOut $ unwords [ "invite-accept-done", showInviteToken token ] -- cgit v1.2.3