diff options
author | James Crayne <jim.crayne@gmail.com> | 2017-10-31 20:54:02 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2017-10-31 20:54:02 +0000 |
commit | 4f707645d5a47f2f88ffcbd926a7dd5f18ec8591 (patch) | |
tree | f739c24739042493ce5820e452f2f146266dd37f /examples/dhtd.hs | |
parent | 1914912b1fb1163987eee378a03324b71aaf0581 (diff) |
allow hooks to be passed in to newTox
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r-- | examples/dhtd.hs | 5 |
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 | |||
79 | import qualified Network.Tox.DHT.Handlers as Tox | 79 | import qualified Network.Tox.DHT.Handlers as Tox |
80 | import qualified Network.Tox.Onion.Transport as Tox | 80 | import qualified Network.Tox.Onion.Transport as Tox |
81 | import qualified Network.Tox.Onion.Handlers as Tox | 81 | import qualified Network.Tox.Onion.Handlers as Tox |
82 | import qualified Network.Tox.Crypto.Handlers as Tox | ||
82 | import Data.Typeable | 83 | import Data.Typeable |
83 | import Roster | 84 | import 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 |