From 1a10c09d6150dbc9e8a1718b710252cb7b38b776 Mon Sep 17 00:00:00 2001 From: Cypher Date: Tue, 3 May 2022 15:05:40 -0500 Subject: use stack lts-18.8 Update text handling to keep uptodate with changes with string conversion, using 'encodeUtf' and 'decodeUtf' where necessary. One update uses an odd encoding to and from JSON, which must be looked at later. --- src/Ssb/Peer/RPC.hs | 2 +- src/Ssb/Peer/RPC/Room.hs | 3 ++- src/Ssb/Peer/RPC/WhoAmI.hs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Ssb/Peer') diff --git a/src/Ssb/Peer/RPC.hs b/src/Ssb/Peer/RPC.hs index 3286a33..1336b5e 100644 --- a/src/Ssb/Peer/RPC.hs +++ b/src/Ssb/Peer/RPC.hs @@ -3,7 +3,7 @@ module Ssb.Peer.RPC where -import Protolude +import Protolude hiding (Handler) import Control.Concurrent.STM import Control.Monad.Fail diff --git a/src/Ssb/Peer/RPC/Room.hs b/src/Ssb/Peer/RPC/Room.hs index 1f53cf0..7be7d2c 100644 --- a/src/Ssb/Peer/RPC/Room.hs +++ b/src/Ssb/Peer/RPC/Room.hs @@ -280,7 +280,8 @@ instance RPC.Handler Room where -- should decode request serve h (RPC.Endpoint ["tunnel", "connect"] RPC.Duplex) args stream = do let args' = - decodeJSON (toS $ Aeson.encode args) :: Either + -- TODO: why encode to JSON then decode from JSON redundantly? + decodeJSON (encodeJSON args) :: Either Text [ConnectRequest] case args' of diff --git a/src/Ssb/Peer/RPC/WhoAmI.hs b/src/Ssb/Peer/RPC/WhoAmI.hs index be979fc..c92c56c 100644 --- a/src/Ssb/Peer/RPC/WhoAmI.hs +++ b/src/Ssb/Peer/RPC/WhoAmI.hs @@ -7,7 +7,7 @@ module Ssb.Peer.RPC.WhoAmI where -import Protolude hiding ( Identity ) +import Protolude hiding ( Handler, Identity ) import Data.Aeson as Aeson (FromJSON,ToJSON) import qualified Ssb.Identity as Ssb -- cgit v1.2.3