summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Connection/Tox.hs5
-rw-r--r--examples/dhtd.hs9
2 files changed, 9 insertions, 5 deletions
diff --git a/Connection/Tox.hs b/Connection/Tox.hs
index a131253d..b0da494a 100644
--- a/Connection/Tox.hs
+++ b/Connection/Tox.hs
@@ -30,6 +30,7 @@ import Control.Concurrent.Lifted
30import GHC.Conc (labelThread) 30import GHC.Conc (labelThread)
31#endif 31#endif
32import GHC.Conc (ThreadStatus (..), threadStatus) 32import GHC.Conc (ThreadStatus (..), threadStatus)
33import System.IO
33 34
34 35
35 36
@@ -135,7 +136,9 @@ setToxPolicy :: Parameters
135 -> Key 136 -> Key
136 -> Policy 137 -> Policy
137 -> IO () 138 -> IO ()
138setToxPolicy params conmap k@(Key me them) policy = case policy of 139setToxPolicy params conmap k@(Key me them) policy = do
140 hPutStrLn stderr $ "C.setToxPolicy "++show (them,policy)
141 case policy of
139 TryingToConnect -> do 142 TryingToConnect -> do
140 mst <- lookupForPolicyChange conmap k policy 143 mst <- lookupForPolicyChange conmap k policy
141 r <- atomically $ lookupContact k (roster params) 144 r <- atomically $ lookupContact k (roster params)
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index 65498699..56d9544d 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -1394,10 +1394,11 @@ toxman announcer toxbkts tox presence = ToxManager
1394 pub 1394 pub
1395 1395
1396 , setToxConnectionPolicy = \me them p -> do 1396 , setToxConnectionPolicy = \me them p -> do
1397 hPutStrLn stderr $ "toxman ConnectionPolicy " ++ show (me,them,p) 1397 let m = do meid <- readMaybe $ T.unpack $ T.take 43 me
1398 forM_ (do meid <- readMaybe $ T.unpack $ T.take 43 me 1398 themid <- readMaybe $ T.unpack $ T.take 43 them
1399 themid <- readMaybe $ T.unpack $ T.take 43 them 1399 return $ Tox.Key meid themid
1400 return $ Tox.Key meid themid) $ \k -> do 1400 hPutStrLn stderr $ "toxman ConnectionPolicy " ++ show (me,them,p,fmap (const ()) m)
1401 forM_ m $ \k -> do
1401 setPolicy (Tox.toxMgr tox) k p 1402 setPolicy (Tox.toxMgr tox) k p
1402 case p of 1403 case p of
1403 TryingToConnect -> do 1404 TryingToConnect -> do