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