diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-29 15:13:44 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-29 15:13:44 -0400 |
commit | 37eb3fc850cb28bcf72d971b4fff99902bbce811 (patch) | |
tree | 7271540eaff79baa3a2b5ccbb089a282d28e7f02 /ControlWindow.hs | |
parent | a61df1522ddf8a36839cf1180d3b16e354459e9a (diff) | |
download | debug-me-37eb3fc850cb28bcf72d971b4fff99902bbce811.tar.gz |
use developer control window to tell when write access is granted
Diffstat (limited to 'ControlWindow.hs')
-rw-r--r-- | ControlWindow.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ControlWindow.hs b/ControlWindow.hs index 02cffd6..edd493e 100644 --- a/ControlWindow.hs +++ b/ControlWindow.hs @@ -29,6 +29,10 @@ import Prelude winDesc :: String winDesc = "debug-me session control and chat window" +displayInControlWindow :: TMChan ControlInput -> String -> IO () +displayInControlWindow ichan msg = atomically $ + writeTMChan ichan (ControlWindowMessage msg) + controlWindow :: ControlOpts -> IO () controlWindow _ = do putStrLn $ "** " ++ winDesc @@ -92,6 +96,9 @@ displayInput ochan ichan promptchan responsechan = loop where loop = go =<< atomically (readTMChan ichan) go Nothing = return () + go (Just (ControlWindowMessage m)) = do + putStrLn m + loop go (Just (ControlInputAction (SessionKey k))) = do askToAllow ochan promptchan responsechan k loop |