lambdabot-irc-plugins 5.1 → 5.1.0.1
raw patch · 2 files changed
+10/−4 lines, 2 files
Files
lambdabot-irc-plugins.cabal view
@@ -1,5 +1,5 @@ name: lambdabot-irc-plugins-version: 5.1+version: 5.1.0.1 license: GPL license-file: LICENSE@@ -22,7 +22,7 @@ . [topic] Modify channel topics. -homepage: http://haskell.org/haskellwiki/Lambdabot+homepage: https://wiki.haskell.org/Lambdabot build-type: Simple cabal-version: >= 1.8
src/Lambdabot/Plugin/IRC/IRC.hs view
@@ -81,12 +81,18 @@ . encodeParams (ircMsgParams msg) where encodePrefix [] = id- encodePrefix prefix = showChar ':' . showString prefix . showChar ' '+ encodePrefix prefix = showChar ':' . showString' prefix . showChar ' ' encodeCommand cmd = showString cmd encodeParams [] = id- encodeParams (p:ps) = showChar ' ' . showString p . encodeParams ps+ encodeParams (p:ps) = showChar ' ' . showString' p . encodeParams ps++ -- IrcMessage is supposed to contain strings that are lists of bytes, but+ -- if a plugin messes up the encoding then we may end up with arbitrary+ -- Unicode codepoints. This is dangerous (\x10a would produce a newline!),+ -- so we sanitize the message here.+ showString' = showString . map (\c -> if c > '\xFF' then '?' else c) -- | 'decodeMessage' Takes an input line from the IRC protocol stream -- and decodes it into a message. TODO: this has too many parameters.