From 7c3169c7c940cae50c56b62afe4dcd0579626c99 Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 31 May 2018 05:20:54 -0400 Subject: Do-nothing tox-to-xmpp conversion conduits. --- ToxToXMPP.hs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'ToxToXMPP.hs') diff --git a/ToxToXMPP.hs b/ToxToXMPP.hs index e9e975be..eec04846 100644 --- a/ToxToXMPP.hs +++ b/ToxToXMPP.hs @@ -3,23 +3,19 @@ module ToxToXMPP where import Data.Conduit as C +import qualified Data.Conduit.List as CL import Data.XML.Types as XML import Network.Tox.Crypto.Transport as Tox +import XMPPServer as XMPP -import Announcer import ClientState -import Connection -import Connection.Tox as Connection import Control.Concurrent.STM -import Control.Concurrent.STM.TChan import Control.Monad import Crypto.Tox import Data.Bits import Data.Function -import qualified Data.HashMap.Strict as HashMap import qualified Data.Map as Map import qualified Data.Set as Set -import qualified Data.Set as Set import qualified Data.Text as T ;import Data.Text (Text) import Data.Word @@ -29,7 +25,6 @@ import Network.Tox.DHT.Transport (FriendRequest (..)) import Network.Tox.NodeId import Network.Tox.Onion.Transport (OnionData (..)) import Presence -import XMPPServer #ifdef THREAD_DEBUG import Control.Concurrent.Lifted.Instrument #else @@ -38,13 +33,13 @@ import GHC.Conc (labelThread) #endif xmppToTox :: Conduit XML.Event IO Tox.CryptoMessage -xmppToTox = _todo - -toxToXmpp :: Conduit Tox.CryptoMessage IO XML.Event -toxToXmpp = _todo +xmppToTox = do + awaitForever (\_ -> return ()) -accountJID :: Account -> Text -accountJID acnt = _todo -- Or perhaps this should be passed in from PresenceState +toxToXmpp :: Text -> Conduit Tox.CryptoMessage IO XML.Event +toxToXmpp toxhost = do + CL.sourceList $ XMPP.greet' "jabber:server" toxhost + awaitForever (\_ -> return ()) key2jid :: Word32 -> PublicKey -> Text key2jid nospam key = T.pack $ show $ NoSpamId nsp key -- cgit v1.2.3