diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/Tox/ContactInfo.hs | 6 |
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 | ||
73 | getContact :: PublicKey -> Account extra -> STM (Maybe Contact) | ||
74 | getContact remoteUserKey acc = do | ||
75 | let rkey = key2id remoteUserKey | ||
76 | cmap <- readTVar (contacts acc) | ||
77 | return $ HashMap.lookup rkey cmap | ||
78 | |||
73 | updateAccount' :: PublicKey -> Account extra -> (Contact -> STM ()) -> STM () | 79 | updateAccount' :: PublicKey -> Account extra -> (Contact -> STM ()) -> STM () |
74 | updateAccount' remoteUserKey acc updater = do | 80 | updateAccount' remoteUserKey acc updater = do |
75 | let rkey = key2id remoteUserKey | 81 | let rkey = key2id remoteUserKey |