diff options
author | Julien Dessaux | 2011-11-03 18:49:43 +0100 |
---|---|---|
committer | Julien Dessaux | 2011-11-03 18:50:44 +0100 |
commit | 50c8c0801ebc3707dfd86c2bc31a6768110d1821 (patch) | |
tree | 387104c5f2f41f484c7f5a425435b6589a94584f | |
parent | Other cosmetics + version upgrade. (diff) | |
download | hsbot-50c8c0801ebc3707dfd86c2bc31a6768110d1821.tar.gz hsbot-50c8c0801ebc3707dfd86c2bc31a6768110d1821.tar.bz2 hsbot-50c8c0801ebc3707dfd86c2bc31a6768110d1821.zip |
Updated to support the latest version of the tls module.
Diffstat (limited to '')
-rw-r--r-- | Hsbot/Core.hs | 2 | ||||
-rw-r--r-- | Hsbot/Types.hs | 2 | ||||
-rw-r--r-- | Hsbot/Utils.hs | 2 | ||||
-rw-r--r-- | hsbot.cabal | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs index 4dc1e92..7f97918 100644 --- a/Hsbot/Core.hs +++ b/Hsbot/Core.hs @@ -103,7 +103,7 @@ runHsbot die_msgs = do -- TODO : kill plugin threads return code -botReader :: BotEnv -> Handle -> Maybe TLSCtx -> Chan Message -> IO () +botReader :: BotEnv -> Handle -> Maybe (TLSCtx Handle) -> Chan Message -> IO () botReader env _ (Just ctx) chan = forever $ fmap L.toString (recvData ctx) `catch` handleIOException env "botReader died" >>= handleIncomingStr chan botReader env handle Nothing chan = forever $ diff --git a/Hsbot/Types.hs b/Hsbot/Types.hs index 7ca9ee0..b0110c2 100644 --- a/Hsbot/Types.hs +++ b/Hsbot/Types.hs @@ -34,7 +34,7 @@ data BotEnv = BotEnv , envThreadIdsMv :: MVar [ThreadId] , envConfig :: Config , envTLS :: Maybe TLSParams - , envTLSCtx :: Maybe TLSCtx + , envTLSCtx :: Maybe (TLSCtx Handle) } -- The bot monad diff --git a/Hsbot/Utils.hs b/Hsbot/Utils.hs index 5d5c424..d29345c 100644 --- a/Hsbot/Utils.hs +++ b/Hsbot/Utils.hs @@ -48,7 +48,7 @@ hasAccess (Just mask) right = | otherwise = False -- Helpers -sendStr :: BotEnv -> Handle -> Maybe TLSCtx -> String -> IO () +sendStr :: BotEnv -> Handle -> Maybe (TLSCtx Handle) -> String -> IO () sendStr env _ (Just ctx) msg = sendData ctx (L.fromString $ msg ++ "\r\n") `catch` handleIOException env ("sendStr " ++ msg) sendStr env handle Nothing msg = hPutStrLn handle (msg ++ "\r\n") `catch` handleIOException env ("sendStr " ++ msg) diff --git a/hsbot.cabal b/hsbot.cabal index 215d280..481f026 100644 --- a/hsbot.cabal +++ b/hsbot.cabal @@ -1,5 +1,5 @@ Name: hsbot -Version: 0.4.17 +Version: 0.4.18 Cabal-version: >=1.2 Synopsis: A multipurposes IRC bot Description: @@ -44,8 +44,8 @@ Library network, random, safecopy, - tls >= 0.7.1, - tls-extra >= 0.2.0, + tls >= 0.8.1, + tls-extra >= 0.4.0, time, utf8-string, xdg-basedir |