diff options
Diffstat (limited to 'ToxToXMPP.hs')
-rw-r--r-- | ToxToXMPP.hs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/ToxToXMPP.hs b/ToxToXMPP.hs index e9e975be..eec04846 100644 --- a/ToxToXMPP.hs +++ b/ToxToXMPP.hs | |||
@@ -3,23 +3,19 @@ | |||
3 | module ToxToXMPP where | 3 | module ToxToXMPP where |
4 | 4 | ||
5 | import Data.Conduit as C | 5 | import Data.Conduit as C |
6 | import qualified Data.Conduit.List as CL | ||
6 | import Data.XML.Types as XML | 7 | import Data.XML.Types as XML |
7 | import Network.Tox.Crypto.Transport as Tox | 8 | import Network.Tox.Crypto.Transport as Tox |
9 | import XMPPServer as XMPP | ||
8 | 10 | ||
9 | import Announcer | ||
10 | import ClientState | 11 | import ClientState |
11 | import Connection | ||
12 | import Connection.Tox as Connection | ||
13 | import Control.Concurrent.STM | 12 | import Control.Concurrent.STM |
14 | import Control.Concurrent.STM.TChan | ||
15 | import Control.Monad | 13 | import Control.Monad |
16 | import Crypto.Tox | 14 | import Crypto.Tox |
17 | import Data.Bits | 15 | import Data.Bits |
18 | import Data.Function | 16 | import Data.Function |
19 | import qualified Data.HashMap.Strict as HashMap | ||
20 | import qualified Data.Map as Map | 17 | import qualified Data.Map as Map |
21 | import qualified Data.Set as Set | 18 | import qualified Data.Set as Set |
22 | import qualified Data.Set as Set | ||
23 | import qualified Data.Text as T | 19 | import qualified Data.Text as T |
24 | ;import Data.Text (Text) | 20 | ;import Data.Text (Text) |
25 | import Data.Word | 21 | import Data.Word |
@@ -29,7 +25,6 @@ import Network.Tox.DHT.Transport (FriendRequest (..)) | |||
29 | import Network.Tox.NodeId | 25 | import Network.Tox.NodeId |
30 | import Network.Tox.Onion.Transport (OnionData (..)) | 26 | import Network.Tox.Onion.Transport (OnionData (..)) |
31 | import Presence | 27 | import Presence |
32 | import XMPPServer | ||
33 | #ifdef THREAD_DEBUG | 28 | #ifdef THREAD_DEBUG |
34 | import Control.Concurrent.Lifted.Instrument | 29 | import Control.Concurrent.Lifted.Instrument |
35 | #else | 30 | #else |
@@ -38,13 +33,13 @@ import GHC.Conc (labelThread) | |||
38 | #endif | 33 | #endif |
39 | 34 | ||
40 | xmppToTox :: Conduit XML.Event IO Tox.CryptoMessage | 35 | xmppToTox :: Conduit XML.Event IO Tox.CryptoMessage |
41 | xmppToTox = _todo | 36 | xmppToTox = do |
42 | 37 | awaitForever (\_ -> return ()) | |
43 | toxToXmpp :: Conduit Tox.CryptoMessage IO XML.Event | ||
44 | toxToXmpp = _todo | ||
45 | 38 | ||
46 | accountJID :: Account -> Text | 39 | toxToXmpp :: Text -> Conduit Tox.CryptoMessage IO XML.Event |
47 | accountJID acnt = _todo -- Or perhaps this should be passed in from PresenceState | 40 | toxToXmpp toxhost = do |
41 | CL.sourceList $ XMPP.greet' "jabber:server" toxhost | ||
42 | awaitForever (\_ -> return ()) | ||
48 | 43 | ||
49 | key2jid :: Word32 -> PublicKey -> Text | 44 | key2jid :: Word32 -> PublicKey -> Text |
50 | key2jid nospam key = T.pack $ show $ NoSpamId nsp key | 45 | key2jid nospam key = T.pack $ show $ NoSpamId nsp key |