diff options
author | Joe Crayne <joe@jerkface.net> | 2019-10-18 14:43:03 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-01 19:56:25 -0500 |
commit | 000b1badd9403f4da9096597a1f85e4ccc10fb80 (patch) | |
tree | 91988186149b731992d362615cb466dd1275ad23 | |
parent | afe571b7b663cd7f4b95d2c18ebf64c090875e9d (diff) |
Clean up "localchat" thread.
-rw-r--r-- | dht/examples/dhtd.hs | 9 |
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 | ) |
1612 | initJabber opts ssvar announcer mbtox toxdhts toxchat = case portxmpp opts of | 1613 | initJabber 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 | ||
1643 | main :: IO () | 1644 | main :: IO () |
1644 | main = do | 1645 | main = 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 | ||