diff options
Diffstat (limited to 'dht/src/Network/Tox/Session.hs')
-rw-r--r-- | dht/src/Network/Tox/Session.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dht/src/Network/Tox/Session.hs b/dht/src/Network/Tox/Session.hs index 53d63287..1b1c62c4 100644 --- a/dht/src/Network/Tox/Session.hs +++ b/dht/src/Network/Tox/Session.hs | |||
@@ -6,6 +6,7 @@ module Network.Tox.Session | |||
6 | , SessionKey | 6 | , SessionKey |
7 | , Session(..) | 7 | , Session(..) |
8 | , sTheirUserKey | 8 | , sTheirUserKey |
9 | , sTheirDHTKey | ||
9 | , sClose | 10 | , sClose |
10 | , handshakeH | 11 | , handshakeH |
11 | ) where | 12 | ) where |
@@ -95,6 +96,10 @@ sTheirUserKey s = longTermKey $ runIdentity cookie | |||
95 | where | 96 | where |
96 | Cookie _ cookie = handshakeCookie (sReceivedHandshake s) | 97 | Cookie _ cookie = handshakeCookie (sReceivedHandshake s) |
97 | 98 | ||
99 | sTheirDHTKey :: Session -> PublicKey | ||
100 | sTheirDHTKey s = case handshakeCookie $ sReceivedHandshake s of | ||
101 | Cookie _ (Identity cd) -> dhtKey cd | ||
102 | |||
98 | -- | Helper to close the 'Transport' associated with a session. | 103 | -- | Helper to close the 'Transport' associated with a session. |
99 | sClose :: Session -> IO () | 104 | sClose :: Session -> IO () |
100 | sClose s = do | 105 | sClose s = do |