diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 6529e746..bd2df9db 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -706,7 +706,23 @@ main = do | |||
706 | , dhtParseId = readEither :: String -> Either String Tox.NodeId | 706 | , dhtParseId = readEither :: String -> Either String Tox.NodeId |
707 | , dhtSearches = toxSearches | 707 | , dhtSearches = toxSearches |
708 | , dhtFallbackNodes = return [] | 708 | , dhtFallbackNodes = return [] |
709 | , dhtAnnouncables = Map.empty -- TODO | 709 | , dhtAnnouncables = Map.fromList |
710 | [ ("toxid", DHTAnnouncable { announceSendData = \(pubkey,token) -> \case | ||
711 | Just ni -> | ||
712 | Tox.putRendezvous | ||
713 | (Tox.onionTimeout tox) | ||
714 | (Tox.toxCryptoKeys tox) | ||
715 | (Tox.toxOnion tox) | ||
716 | pubkey | ||
717 | token | ||
718 | ni | ||
719 | Nothing -> return Nothing | ||
720 | , announceParseData = \str tokstr -> | ||
721 | return $ do | ||
722 | pubkey <- Tox.id2key <$> readEither str | ||
723 | tok <- readEither tokstr | ||
724 | Right (pubkey,tok) | ||
725 | })] | ||
710 | } | 726 | } |
711 | dhts = Map.fromList $ | 727 | dhts = Map.fromList $ |
712 | ("tox4", toxDHT Tox.routing4) | 728 | ("tox4", toxDHT Tox.routing4) |