diff options
author | joe <joe@jerkface.net> | 2018-05-30 23:53:44 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-05-30 23:53:44 -0400 |
commit | 514d0cad3f2ccaf0e89aadb4ab3067884ec20a6c (patch) | |
tree | a7d15e0d3592f123b10f2da3a458c023bd74de5b /src/Network/Tox/ContactInfo.hs | |
parent | 2cffde93a0d814ebb54bdcbd3d6e598cbaae6ee1 (diff) |
tox: Removed obsolete "userKeys" TVar, use keys from ContactInfo.
Diffstat (limited to 'src/Network/Tox/ContactInfo.hs')
-rw-r--r-- | src/Network/Tox/ContactInfo.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Network/Tox/ContactInfo.hs b/src/Network/Tox/ContactInfo.hs index d9d9a510..df3365a2 100644 --- a/src/Network/Tox/ContactInfo.hs +++ b/src/Network/Tox/ContactInfo.hs | |||
@@ -12,10 +12,11 @@ import qualified Data.HashMap.Strict as HashMap | |||
12 | import Data.Maybe | 12 | import Data.Maybe |
13 | import qualified Data.Set as Set | 13 | import qualified Data.Set as Set |
14 | ;import Data.Set (Set) | 14 | ;import Data.Set (Set) |
15 | import Network.Socket | ||
15 | import Network.Tox.DHT.Transport as DHT | 16 | import Network.Tox.DHT.Transport as DHT |
17 | import Network.Tox.NodeId (id2key) | ||
16 | import Network.Tox.Onion.Transport as Onion | 18 | import Network.Tox.Onion.Transport as Onion |
17 | import System.IO | 19 | import System.IO |
18 | import Network.Socket | ||
19 | 20 | ||
20 | newtype ContactInfo = ContactInfo | 21 | newtype ContactInfo = ContactInfo |
21 | -- | Map our toxid public key to an Account record. | 22 | -- | Map our toxid public key to an Account record. |
@@ -150,3 +151,9 @@ friendRequests (ContactInfo roster) = do | |||
150 | $ HashMap.toList cs | 151 | $ HashMap.toList cs |
151 | return remotes | 152 | return remotes |
152 | 153 | ||
154 | myKeyPairs :: ContactInfo -> STM [(SecretKey,PublicKey)] | ||
155 | myKeyPairs (ContactInfo accounts) = do | ||
156 | acnts <- readTVar accounts | ||
157 | forM (HashMap.toList acnts) $ \(nid, Account{userSecret}) -> do | ||
158 | return (userSecret,id2key nid) | ||
159 | |||