summaryrefslogtreecommitdiff
path: root/examples/dhtd.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r--examples/dhtd.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index 83e8c24f..4b5a1fd7 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -571,9 +571,11 @@ clientSession s@Session{..} sock cnum h = do
571 ks <- atomically $ myKeyPairs roster 571 ks <- atomically $ myKeyPairs roster
572 skey <- maybe (return Nothing) (atomically . dhtSecretKey) 572 skey <- maybe (return Nothing) (atomically . dhtSecretKey)
573 $ Map.lookup netname dhts 573 $ Map.lookup netname dhts
574 hPutClient h . showReport $ map mkrow ks ++ case skey >>= encodeSecret of 574 hPutClient h . showReport $ (map mkrow ks ++) $ fromMaybe [] $ do
575 Just x -> [("",""),("dht-key:",B.unpack x)] 575 sk <- skey
576 Nothing -> [] 576 let pk = Tox.key2id $ toPublic sk
577 x <- encodeSecret sk
578 Just [("",""),("dht-key:",""),(B.unpack x, show pk)]
577 | ("sel",_:expr) <- break isSpace s -> do 579 | ("sel",_:expr) <- break isSpace s -> do
578 ks <- atomically $ map (show . Tox.key2id . snd) <$> myKeyPairs roster 580 ks <- atomically $ map (show . Tox.key2id . snd) <$> myKeyPairs roster
579 case find (isInfixOf expr) ks of 581 case find (isInfixOf expr) ks of