diff options
author | Andrew Cady <d@jerkface.net> | 2018-06-21 22:29:04 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2018-06-21 22:40:41 -0400 |
commit | 5622c6cdce0b8572434e8ab24fbae7f57ffadf3e (patch) | |
tree | bccfc1a212b7b2a1919fabc03bf190adf59554ee /src/Network | |
parent | 4fa78c094f7bd1afa9a7dd72c1f32eb1dd867ac8 (diff) |
start to implement plan in conn-notes.txt
Diffstat (limited to 'src/Network')
-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 |