summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dht/examples/dhtd.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/dht/examples/dhtd.hs b/dht/examples/dhtd.hs
index 3b2f1698..26e01c75 100644
--- a/dht/examples/dhtd.hs
+++ b/dht/examples/dhtd.hs
@@ -1608,9 +1608,10 @@ initJabber :: Options
1608 -> IO ( Maybe XMPPServer 1608 -> IO ( Maybe XMPPServer
1609 , Maybe (Manager TCPStatus T.Text) 1609 , Maybe (Manager TCPStatus T.Text)
1610 , Maybe (PresenceState Pending) 1610 , Maybe (PresenceState Pending)
1611 , IO () -- quit chat thread
1611 ) 1612 )
1612initJabber opts ssvar announcer mbtox toxdhts toxchat = case portxmpp opts of 1613initJabber opts ssvar announcer mbtox toxdhts toxchat = case portxmpp opts of
1613 "" -> return (Nothing,Nothing,Nothing) 1614 "" -> return (Nothing,Nothing,Nothing,return())
1614 p -> do 1615 p -> do
1615 cport <- getBindAddress p True{-IPv6 supported-} 1616 cport <- getBindAddress p True{-IPv6 supported-}
1616 -- TODO: Allow running without an XMPP server-to-server port. 1617 -- TODO: Allow running without an XMPP server-to-server port.
@@ -1638,7 +1639,7 @@ initJabber opts ssvar announcer mbtox toxdhts toxchat = case portxmpp opts of
1638 , ("ngc", toxchat) ] 1639 , ("ngc", toxchat) ]
1639 forkXmpp sv (presenceHooks state chats (verbosity opts) (Just cport) (Just sport)) 1640 forkXmpp sv (presenceHooks state chats (verbosity opts) (Just cport) (Just sport))
1640 conns <- xmppConnections sv 1641 conns <- xmppConnections sv
1641 return (Just sv, Just conns, Just state) 1642 return (Just sv, Just conns, Just state, quitChatService)
1642 1643
1643main :: IO () 1644main :: IO ()
1644main = do 1645main = do
@@ -1757,9 +1758,9 @@ main = do
1757 1758
1758 (mbtox,quitTox,toxdhts,toxips,(taddrs::[SockAddr])) <- initTox opts ssvar keysdb msv invc 1759 (mbtox,quitTox,toxdhts,toxips,(taddrs::[SockAddr])) <- initTox opts ssvar keysdb msv invc
1759 1760
1760 (msv,mconns,mstate) <- initJabber opts ssvar announcer mbtox toxdhts toxchat 1761 (msv,mconns,mstate,quitChat) <- initJabber opts ssvar announcer mbtox toxdhts toxchat
1761 1762
1762 return (mbtox,quitTox,toxdhts,toxips,(taddrs::[SockAddr]),msv,mconns,mstate) 1763 return (mbtox,quitTox >> quitChat,toxdhts,toxips,(taddrs::[SockAddr]),msv,mconns,mstate)
1763 1764
1764 _ <- UPNP.requestPorts "dht-client" $ map (Datagram,) $ baddrs ++ taddrs 1765 _ <- UPNP.requestPorts "dht-client" $ map (Datagram,) $ baddrs ++ taddrs
1765 1766