summaryrefslogtreecommitdiff
path: root/examples/dhtd.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-16 19:49:53 -0400
committerjoe <joe@jerkface.net>2018-06-16 19:49:53 -0400
commit38d75e4ebdc128c55af23e9fc658b9a9ac092ac5 (patch)
tree4e814790061f724b3f14210dae60a86b238a7ea7 /examples/dhtd.hs
parentbf923a15b5865f515db036a23ee43ada38f2c861 (diff)
Integrate toxManager interface with xmpp roster call-outs.
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r--examples/dhtd.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index d7ee040f..65498699 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -1395,12 +1395,15 @@ toxman announcer toxbkts tox presence = ToxManager
1395 1395
1396 , setToxConnectionPolicy = \me them p -> do 1396 , setToxConnectionPolicy = \me them p -> do
1397 hPutStrLn stderr $ "toxman ConnectionPolicy " ++ show (me,them,p) 1397 hPutStrLn stderr $ "toxman ConnectionPolicy " ++ show (me,them,p)
1398 forM_ (do meid <- readMaybe $ T.unpack $ T.take 43 me
1399 themid <- readMaybe $ T.unpack $ T.take 43 them
1400 return $ Tox.Key meid themid) $ \k -> do
1401 setPolicy (Tox.toxMgr tox) k p
1398 case p of 1402 case p of
1399 TryingToConnect -> do 1403 TryingToConnect -> do
1400 let db@ContactInfo{ accounts } = Tox.toxContactInfo tox 1404 let db@ContactInfo{ accounts } = Tox.toxContactInfo tox
1401 sequence_ $ do 1405 sequence_ $ do
1402 meid <- readMaybe $ T.unpack $ T.take 43 me 1406 let Tox.Key meid themid = k
1403 themid <- readMaybe $ T.unpack $ T.take 43 them
1404 Just $ atomically $ do 1407 Just $ atomically $ do
1405 accs <- readTVar accounts 1408 accs <- readTVar accounts
1406 case HashMap.lookup meid accs of 1409 case HashMap.lookup meid accs of