summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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