diff options
Diffstat (limited to 'src/Ssb/Peer/RPC')
-rw-r--r-- | src/Ssb/Peer/RPC/Gossip.hs | 4 | ||||
-rw-r--r-- | src/Ssb/Peer/RPC/Room.hs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Ssb/Peer/RPC/Gossip.hs b/src/Ssb/Peer/RPC/Gossip.hs index 80e1aac..97eff4c 100644 --- a/src/Ssb/Peer/RPC/Gossip.hs +++ b/src/Ssb/Peer/RPC/Gossip.hs @@ -103,7 +103,7 @@ newGossiper = do return $ Gossiper mVar addFeed :: ToJSON a => Gossiper a -> Feed.Feed a -> IO () -addFeed (Gossiper (mFeeds)) feed = do +addFeed (Gossiper mFeeds) feed = do atomically $ do feeds <- takeTMVar mFeeds putTMVar mFeeds (Feed.insert feed feeds) @@ -115,7 +115,7 @@ writeFeed stream (Feed.Feed _ msgs) = do (\msg -> do let msg' = Feed.encodeJSONVerifiableMessage msg err <- RPC.writeStream stream def (RPC.JSONPayload msg') - either (\err -> putStrLn err) (\_ -> return ()) err + either putStrLn (\_ -> return ()) err ) instance ToJSON a => RPC.Handler (Gossiper a) where diff --git a/src/Ssb/Peer/RPC/Room.hs b/src/Ssb/Peer/RPC/Room.hs index 7be7d2c..96c19e8 100644 --- a/src/Ssb/Peer/RPC/Room.hs +++ b/src/Ssb/Peer/RPC/Room.hs @@ -287,7 +287,7 @@ instance RPC.Handler Room where case args' of Left err -> return $ Left err Right [connReq] -> connect h stream connReq - otherwise -> return $ Left "bad target argument" + _ -> return $ Left "bad target argument" serve h (RPC.Endpoint ["tunnel", "endpoints"] _) _ stream = do err <- registerPeer h stream @@ -304,7 +304,7 @@ instance RPC.Handler Room where where while f = do continue <- f - if continue then (while f) else return False + if continue then while f else return False serve room (RPC.Endpoint ["tunnel", "leave"] _) _ stream = leave' room (RPC.peer stream) @@ -317,7 +317,7 @@ instance RPC.Handler Room where RPC.writeStreamJSON stream resp -- HACK: return OK when endpoint not known to avoid disconnecting clients - serve room endpoint@otherwise arg stream = return . return $ () + serve room endpoint arg stream = return . return $ () --serve room endpoint@otherwise arg stream = (RPC.notFoundHandlerFunc endpoint) arg stream notifyConnect _ _ = return . return $ () |