summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-06-21 22:29:04 -0400
committerAndrew Cady <d@jerkface.net>2018-06-21 22:40:41 -0400
commit5622c6cdce0b8572434e8ab24fbae7f57ffadf3e (patch)
treebccfc1a212b7b2a1919fabc03bf190adf59554ee /src
parent4fa78c094f7bd1afa9a7dd72c1f32eb1dd867ac8 (diff)
start to implement plan in conn-notes.txt
Diffstat (limited to 'src')
-rw-r--r--src/Network/Tox/ContactInfo.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Network/Tox/ContactInfo.hs b/src/Network/Tox/ContactInfo.hs
index 5135813a..e76e2f1b 100644
--- a/src/Network/Tox/ContactInfo.hs
+++ b/src/Network/Tox/ContactInfo.hs
@@ -70,6 +70,12 @@ initContact = Contact <$> newTVar Nothing
70 <*> newTVar Nothing 70 <*> newTVar Nothing
71 <*> newTVar Nothing 71 <*> newTVar Nothing
72 72
73getContact :: PublicKey -> Account extra -> STM (Maybe Contact)
74getContact remoteUserKey acc = do
75 let rkey = key2id remoteUserKey
76 cmap <- readTVar (contacts acc)
77 return $ HashMap.lookup rkey cmap
78
73updateAccount' :: PublicKey -> Account extra -> (Contact -> STM ()) -> STM () 79updateAccount' :: PublicKey -> Account extra -> (Contact -> STM ()) -> STM ()
74updateAccount' remoteUserKey acc updater = do 80updateAccount' remoteUserKey acc updater = do
75 let rkey = key2id remoteUserKey 81 let rkey = key2id remoteUserKey