summaryrefslogtreecommitdiff
path: root/src/Network/Tox/ContactInfo.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-05-30 23:53:44 -0400
committerjoe <joe@jerkface.net>2018-05-30 23:53:44 -0400
commit514d0cad3f2ccaf0e89aadb4ab3067884ec20a6c (patch)
treea7d15e0d3592f123b10f2da3a458c023bd74de5b /src/Network/Tox/ContactInfo.hs
parent2cffde93a0d814ebb54bdcbd3d6e598cbaae6ee1 (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.hs9
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
12import Data.Maybe 12import Data.Maybe
13import qualified Data.Set as Set 13import qualified Data.Set as Set
14 ;import Data.Set (Set) 14 ;import Data.Set (Set)
15import Network.Socket
15import Network.Tox.DHT.Transport as DHT 16import Network.Tox.DHT.Transport as DHT
17import Network.Tox.NodeId (id2key)
16import Network.Tox.Onion.Transport as Onion 18import Network.Tox.Onion.Transport as Onion
17import System.IO 19import System.IO
18import Network.Socket
19 20
20newtype ContactInfo = ContactInfo 21newtype 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
154myKeyPairs :: ContactInfo -> STM [(SecretKey,PublicKey)]
155myKeyPairs (ContactInfo accounts) = do
156 acnts <- readTVar accounts
157 forM (HashMap.toList acnts) $ \(nid, Account{userSecret}) -> do
158 return (userSecret,id2key nid)
159