diff options
author | Joe Crayne <joe@jerkface.net> | 2018-09-07 11:38:07 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-09-07 13:18:56 -0400 |
commit | 87b3f98435ea74abfa72e120eca5940bb2974831 (patch) | |
tree | 0b7e5caeabf21bea723cf22581729f70e7dba20e /examples | |
parent | 6f9144a2ddd447b6cf8d0bbfec3a00dd2ba07c78 (diff) |
xmpp: cache stream name
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index cdaa73ed..db8664e8 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -1576,9 +1576,11 @@ announceToxJabberPeer :: PublicKey -- ^ This node's long-term user key. | |||
1576 | -> IO (Maybe (Tox.NetCryptoSession -> Tox.NetCryptoSession)) | 1576 | -> IO (Maybe (Tox.NetCryptoSession -> Tox.NetCryptoSession)) |
1577 | announceToxJabberPeer me them echan laddr saddr pingflag tsrc tsnk | 1577 | announceToxJabberPeer me them echan laddr saddr pingflag tsrc tsnk |
1578 | = do | 1578 | = do |
1579 | atomically $ writeTChan echan | 1579 | atomically $ do |
1580 | ( (saddr, ConnectionData (Left (Local laddr)) XMPPServer.Tox (xmppHostname me) ) | 1580 | v <- newTVar Nothing |
1581 | , Tcp.Connection pingflag xsrc xsnk ) | 1581 | writeTChan echan |
1582 | ( (saddr, ConnectionData (Left (Local laddr)) XMPPServer.Tox (xmppHostname me) v) | ||
1583 | , Tcp.Connection pingflag xsrc xsnk ) | ||
1582 | return Nothing | 1584 | return Nothing |
1583 | where | 1585 | where |
1584 | xsrc = tsrc =$= toxToXmpp laddr me (xmppHostname them) | 1586 | xsrc = tsrc =$= toxToXmpp laddr me (xmppHostname them) |