diff options
author | joe <joe@jerkface.net> | 2018-06-18 06:14:11 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-18 06:14:11 -0400 |
commit | 19364a287f7083fc60beed2d6eae3dd71d27e737 (patch) | |
tree | bb784eeb3c8acb25fd8b656142d92aac2dd096ca /examples | |
parent | 2dbb1e710d6d58fc00126d84763ec3597d92437d (diff) |
tox: Automatically share dhtkey with roster contacts.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index d7a069b4..28bfc9b4 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -1718,7 +1718,13 @@ main = runResourceT $ liftBaseWith $ \resT -> do | |||
1718 | forM_ msv $ \sv -> do | 1718 | forM_ msv $ \sv -> do |
1719 | let Tox.HaveDHTKey saddr = Tox.ncSockAddr netcrypto | 1719 | let Tox.HaveDHTKey saddr = Tox.ncSockAddr netcrypto |
1720 | announceToxJabberPeer (Tox.ncTheirPublicKey netcrypto) (xmppEventChannel sv) addrTox saddr pingflag xmppSrc xmppSink | 1720 | announceToxJabberPeer (Tox.ncTheirPublicKey netcrypto) (xmppEventChannel sv) addrTox saddr pingflag xmppSrc xmppSink |
1721 | -- TODO: Update toxContactInfo, connected. | 1721 | forM_ mbtox $ \tox -> do |
1722 | let ContactInfo{accounts} = Tox.toxContactInfo tox | ||
1723 | mbacc <- HashMap.lookup (Tox.key2id $ Tox.ncMyPublicKey netcrypto) | ||
1724 | <$> atomically (readTVar accounts) | ||
1725 | forM_ mbacc $ \acnt -> do | ||
1726 | now <- getPOSIXTime | ||
1727 | atomically $ setEstablished now (Tox.ncTheirPublicKey netcrypto) acnt | ||
1722 | atomically $ do | 1728 | atomically $ do |
1723 | supply <- readTVar (Tox.listenerIDSupply netCryptoSessionsState) | 1729 | supply <- readTVar (Tox.listenerIDSupply netCryptoSessionsState) |
1724 | let (listenerId,supply') = freshId supply | 1730 | let (listenerId,supply') = freshId supply |