From 825962518c6ad00279fc23e8e1dec746980e483f Mon Sep 17 00:00:00 2001 From: "jim@bo" Date: Wed, 20 Jun 2018 22:40:37 -0400 Subject: More DPut stuff * verbose/quiet without args shows report * verbose all - sets all tags verbose * quiet all - sets all tags quiet * XMisc defaults to verbose, everything else quiet * new XMan tag for ToxManager related stuff * s/hputStrLn stderr/dput XMisc/ in daemon code --- Presence/Presence.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Presence/Presence.hs') diff --git a/Presence/Presence.hs b/Presence/Presence.hs index 2f59a52f..18bde516 100644 --- a/Presence/Presence.hs +++ b/Presence/Presence.hs @@ -62,6 +62,7 @@ import Util import qualified Connection import Network.Tox.NodeId (id2key,key2id) import Crypto.Tox (decodeSecret) +import DPut isPeerKey :: ConnectionKey -> Bool isPeerKey k = case k of { PeerKey {} -> True ; _ -> False } @@ -239,23 +240,23 @@ chooseResourceName state k addr clientsNameForMe desired = do #endif cfs <- map Text.pack <$> listDirectory cdir `catchIOError` (\e -> return []) let profiles = filter (\f -> Text.toLower f == Text.toLower wanted_profile0) cfs - -- hPutStrLn stderr $ "Toxmpp profile " ++ show (user,wanted_profile0,profiles,cfs) + -- dput XMisc $ "Toxmpp profile " ++ show (user,wanted_profile0,profiles,cfs) let wanted_profile = head $ profiles ++ [wanted_profile0] secs <- configText ConfigFiles.getSecrets user wanted_profile case secs of sec:_ | Just s <- decodeSecret (Text.encodeUtf8 sec) , map toLower (show $ key2id $ toPublic s) == map toLower (Text.unpack pub) -> do activateAccount toxman k wanted_profile s - hPutStrLn stderr $ "loaded tox secret " ++ show sec + dput XMisc $ "loaded tox secret " ++ show sec return wanted_profile _ -> do -- XXX: We should probably fail to connect when an -- invalid Tox profile is used. For now, we'll -- fall back to the Unix account login. - hPutStrLn stderr "failed to find tox secret" + dput XMisc "failed to find tox secret" return "." ("*.tox","") -> do - hPutStrLn stderr $ "TODO: Match single tox key profile or generate first." + dput XMisc $ "TODO: Match single tox key profile or generate first." -- TODO: Match single tox key profile or generate first. _todo _ -> return "." -- cgit v1.2.3