diff --git a/Main.hs b/Main.hs index 43e1450660..b245d39ba8 100644 --- a/Main.hs +++ b/Main.hs @@ -110,7 +110,6 @@ chatHelpInfo = \/accept - accept \n\ \ (a string that starts from \"smp::\")\n\ \ from your contact \n\ - \/chat - resume chat with \n\ \/name - set to use in invitations\n\ \@ - send (any string) to contact \n\ \ @ can be omitted to send to previous" @@ -173,7 +172,8 @@ sendToChatTerm ChatClient {outQ, username} ChatTerminal {outputQ} = forever $ do atomically . writeTBQueue outputQ $ serializeChatResponse name resp sendToAgent :: ChatClient -> ChatTerminal -> AgentClient -> IO () -sendToAgent ChatClient {inQ, smpServer} ct AgentClient {rcvQ} = +sendToAgent ChatClient {inQ, smpServer} ct AgentClient {rcvQ} = do + atomically $ writeTBQueue rcvQ ("1", "", SUBALL) -- hack for subscribing to all forever . atomically $ do cmd <- readTBQueue inQ writeTBQueue rcvQ `mapM_` agentTransmission cmd @@ -209,7 +209,7 @@ receiveFromAgent t ct c = forever . atomically $ do END -> Disconnected $ Contact a MSG {m_body} -> ReceivedMessage (Contact a) m_body SENT _ -> NoChatResponse - OK -> YesYes + OK -> Connected $ Contact a -- hack for subscribing to all ERR e -> ChatError e setActiveContact :: ChatResponse -> STM () setActiveContact = \case