From 041571f971326a94d389f81845c434b2bd6fd365 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sat, 3 Nov 2018 00:50:32 -0400 Subject: Implemented showKey for xmpp/tox connection manager. --- examples/dhtd.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/dhtd.hs') diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 892fc88c..bef09b75 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs @@ -1693,8 +1693,7 @@ onNewToxSession sv ssvar ContactInfo{accounts} addrTox netcrypto = do selectManager :: Maybe (t -> ToxManager clientAddress) -> Manager Tcp.TCPStatus T.Text -> T.Text -> Manager Pending T.Text selectManager mtman tcp profile = case T.splitAt 43 profile of (k,".tox") | Just tman <- mtman - -> let _ = _ - -- The following error call is safe because the toxConnections field + -> let -- The following error call is safe because the toxConnections field -- does not make use of the PresenceState passed to tman. tox = toxConnections $ tman $ error "PresenseState" tkey them = do @@ -1724,6 +1723,7 @@ selectManager mtman tcp profile = case T.splitAt 43 profile of dput XMan $ "reverseAddress(tox)" ++ show (T.take 8 k,paddr) ++ ": " ++ show r return r + , showKey = \key -> T.unpack key ++ ".tox" , setPolicy = \them -> case tkey them of Just tk -> \p -> setPolicy tox tk p Nothing -> \p -> return () @@ -1745,6 +1745,7 @@ selectManager mtman tcp profile = case T.splitAt 43 profile of dput XMan $ "reverseAddress(tcp) " ++ show (profile,paddr) reverseAddress tcp paddr + , showKey = showKey tcp , setPolicy = setPolicy tcp , status = \k -> fmap XMPPStatus <$> status tcp k , connections = connections tcp -- cgit v1.2.3