summaryrefslogtreecommitdiff
path: root/ToxManager.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ToxManager.hs')
-rw-r--r--ToxManager.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/ToxManager.hs b/ToxManager.hs
index 793a3b8a..44b7a5ef 100644
--- a/ToxManager.hs
+++ b/ToxManager.hs
@@ -63,6 +63,8 @@ import Connection
63import Connection.Tcp (TCPStatus) 63import Connection.Tcp (TCPStatus)
64import GHC.Conc (unsafeIOToSTM) 64import GHC.Conc (unsafeIOToSTM)
65 65
66data Pending = ToxStatus ToxProgress | XMPPStatus TCPStatus
67
66 68
67toxAnnounceSendData :: Tox.Tox JabberClients 69toxAnnounceSendData :: Tox.Tox JabberClients
68 -> PublicKey 70 -> PublicKey
@@ -96,7 +98,7 @@ toxman :: TVar (Map.Map Uniq24 AggregateSession)
96 -> Announcer 98 -> Announcer
97 -> [(String,TVar (BucketList Tox.NodeInfo))] 99 -> [(String,TVar (BucketList Tox.NodeInfo))]
98 -> Tox.Tox JabberClients 100 -> Tox.Tox JabberClients
99 -> PresenceState TCPStatus 101 -> PresenceState Pending
100 -> ToxManager ClientAddress 102 -> ToxManager ClientAddress
101toxman ssvar announcer toxbkts tox presence = ToxManager 103toxman ssvar announcer toxbkts tox presence = ToxManager
102 { activateAccount = \k pubname seckey -> do 104 { activateAccount = \k pubname seckey -> do
@@ -248,7 +250,7 @@ initPerClient = do
248data ToxToXMPP = ToxToXMPP 250data ToxToXMPP = ToxToXMPP
249 { txAnnouncer :: Announcer 251 { txAnnouncer :: Announcer
250 , txAccount :: Account JabberClients 252 , txAccount :: Account JabberClients
251 , txPresence :: PresenceState TCPStatus 253 , txPresence :: PresenceState Pending
252 , txTox :: Tox JabberClients 254 , txTox :: Tox JabberClients
253 , txSessions :: TVar (Map.Map Uniq24 AggregateSession) 255 , txSessions :: TVar (Map.Map Uniq24 AggregateSession)
254 } 256 }
@@ -552,7 +554,7 @@ updateRoster tx them = do
552-- | Returns a list of nospam values to use for friend requests to send to a 554-- | Returns a list of nospam values to use for friend requests to send to a
553-- remote peer. This list is non-empty only when it is desirable to send 555-- remote peer. This list is non-empty only when it is desirable to send
554-- friend requests. 556-- friend requests.
555checkSoliciting :: PresenceState TCPStatus -> PublicKey -> PublicKey -> Contact -> IO [NoSpam] 557checkSoliciting :: PresenceState Pending -> PublicKey -> PublicKey -> Contact -> IO [NoSpam]
556checkSoliciting presence me them contact = do 558checkSoliciting presence me them contact = do
557 let theirhost = T.pack $ show (key2id them) ++ ".tox" 559 let theirhost = T.pack $ show (key2id them) ++ ".tox"
558 myhost = T.pack $ show (key2id me) ++ ".tox" 560 myhost = T.pack $ show (key2id me) ++ ".tox"
@@ -658,7 +660,7 @@ stopConnecting ToxToXMPP{txAnnouncer=announcer,txAccount=acnt} them reason = do
658 cancel announcer akeyD 660 cancel announcer akeyD
659 661
660forkAccountWatcher :: TVar (Map.Map Uniq24 AggregateSession) 662forkAccountWatcher :: TVar (Map.Map Uniq24 AggregateSession)
661 -> Account JabberClients -> Tox JabberClients -> PresenceState TCPStatus -> Announcer -> IO ThreadId 663 -> Account JabberClients -> Tox JabberClients -> PresenceState Pending -> Announcer -> IO ThreadId
662forkAccountWatcher ssvar acc tox st announcer = forkIO $ do 664forkAccountWatcher ssvar acc tox st announcer = forkIO $ do
663 myThreadId >>= flip labelThread ("online:" 665 myThreadId >>= flip labelThread ("online:"
664 ++ show (key2id $ toPublic $ userSecret acc)) 666 ++ show (key2id $ toPublic $ userSecret acc))