diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/IRC.hs | 6 | ||||
-rw-r--r-- | src/Main.hs | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -4,11 +4,12 @@ import Control.Monad (forM_) import Control.Monad.IO.Class (liftIO) import qualified Data.ByteString.Char8 as Char8 import Data.Char +import Data.Text (Text) +import qualified Data.Text as T import Network.IRC.Client -- import Network.IRC.Client.Events import Lens.Micro -import Data.Text (Text) -import qualified Data.Text as T +import System.IO (hFlush, stdout) connectIRC :: (Text -> Bool) -> (Text -> IO [Text]) -> IO () @@ -49,6 +50,7 @@ noticeHandler = EventHandler _ -> Nothing) (\_ () -> do liftIO $ putStrLn "Identification confirmation received, joining channel" + liftIO $ hFlush stdout send $ Join (T.pack "#haskell")) privmsgHandler :: (Text -> Bool) -> (Text -> IO [Text]) -> EventHandler s diff --git a/src/Main.hs b/src/Main.hs index 88a7259..9987b29 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -6,6 +6,7 @@ import Data.Text (Text) import qualified Data.Text as T import System.Environment (getArgs) import System.Exit (die) +import System.IO (hFlush, stdout) import Ghci import IRC @@ -29,6 +30,7 @@ mainIRC = do (\t -> T.take 2 t == T.pack "% ") (\recvmsg -> do putStrLn $ "Responding to " ++ T.unpack recvmsg + hFlush stdout ghci <- takeMVar ghcivar (ghci', msgs) <- runInGhci ghci (T.drop 2 recvmsg) putMVar ghcivar ghci' |