summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2017-10-31 20:54:02 +0000
committerJames Crayne <jim.crayne@gmail.com>2017-10-31 20:54:02 +0000
commit4f707645d5a47f2f88ffcbd926a7dd5f18ec8591 (patch)
treef739c24739042493ce5820e452f2f146266dd37f /examples
parent1914912b1fb1163987eee378a03324b71aaf0581 (diff)
allow hooks to be passed in to newTox
Diffstat (limited to 'examples')
-rw-r--r--examples/dhtd.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index a2ebdf86..fa4ce95b 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -79,6 +79,7 @@ import qualified Network.Tox.DHT.Transport as Tox
79import qualified Network.Tox.DHT.Handlers as Tox 79import qualified Network.Tox.DHT.Handlers as Tox
80import qualified Network.Tox.Onion.Transport as Tox 80import qualified Network.Tox.Onion.Transport as Tox
81import qualified Network.Tox.Onion.Handlers as Tox 81import qualified Network.Tox.Onion.Handlers as Tox
82import qualified Network.Tox.Crypto.Handlers as Tox
82import Data.Typeable 83import Data.Typeable
83import Roster 84import Roster
84 85
@@ -790,7 +791,9 @@ main = do
790 "" -> return (Nothing,return (), Map.empty, return [],[]) 791 "" -> return (Nothing,return (), Map.empty, return [],[])
791 toxport -> do 792 toxport -> do
792 addrTox <- getBindAddress toxport (ip6tox opts) 793 addrTox <- getBindAddress toxport (ip6tox opts)
793 tox <- Tox.newTox keysdb addrTox 794 crypto <- Tox.newCrypto
795 netCryptoSessionsState <- Tox.newSessionsState crypto Tox.defaultUnRecHook Tox.defaultCryptoDataHooks
796 tox <- Tox.newTox keysdb addrTox (Just netCryptoSessionsState)
794 quitTox <- Tox.forkTox tox 797 quitTox <- Tox.forkTox tox
795 798
796 toxSearches <- atomically $ newTVar Map.empty 799 toxSearches <- atomically $ newTVar Map.empty