Updated to support the latest version of the tls module.
This commit is contained in:
parent
7cefea4cbc
commit
50c8c0801e
4 changed files with 6 additions and 6 deletions
|
@ -103,7 +103,7 @@ runHsbot die_msgs = do
|
||||||
-- TODO : kill plugin threads
|
-- TODO : kill plugin threads
|
||||||
return code
|
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 $
|
botReader env _ (Just ctx) chan = forever $
|
||||||
fmap L.toString (recvData ctx) `catch` handleIOException env "botReader died" >>= handleIncomingStr chan
|
fmap L.toString (recvData ctx) `catch` handleIOException env "botReader died" >>= handleIncomingStr chan
|
||||||
botReader env handle Nothing chan = forever $
|
botReader env handle Nothing chan = forever $
|
||||||
|
|
|
@ -34,7 +34,7 @@ data BotEnv = BotEnv
|
||||||
, envThreadIdsMv :: MVar [ThreadId]
|
, envThreadIdsMv :: MVar [ThreadId]
|
||||||
, envConfig :: Config
|
, envConfig :: Config
|
||||||
, envTLS :: Maybe TLSParams
|
, envTLS :: Maybe TLSParams
|
||||||
, envTLSCtx :: Maybe TLSCtx
|
, envTLSCtx :: Maybe (TLSCtx Handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
-- The bot monad
|
-- The bot monad
|
||||||
|
|
|
@ -48,7 +48,7 @@ hasAccess (Just mask) right =
|
||||||
| otherwise = False
|
| otherwise = False
|
||||||
|
|
||||||
-- Helpers
|
-- 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 _ (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)
|
sendStr env handle Nothing msg = hPutStrLn handle (msg ++ "\r\n") `catch` handleIOException env ("sendStr " ++ msg)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: hsbot
|
Name: hsbot
|
||||||
Version: 0.4.17
|
Version: 0.4.18
|
||||||
Cabal-version: >=1.2
|
Cabal-version: >=1.2
|
||||||
Synopsis: A multipurposes IRC bot
|
Synopsis: A multipurposes IRC bot
|
||||||
Description:
|
Description:
|
||||||
|
@ -44,8 +44,8 @@ Library
|
||||||
network,
|
network,
|
||||||
random,
|
random,
|
||||||
safecopy,
|
safecopy,
|
||||||
tls >= 0.7.1,
|
tls >= 0.8.1,
|
||||||
tls-extra >= 0.2.0,
|
tls-extra >= 0.4.0,
|
||||||
time,
|
time,
|
||||||
utf8-string,
|
utf8-string,
|
||||||
xdg-basedir
|
xdg-basedir
|
||||||
|
|
Reference in a new issue