diff options
Diffstat (limited to 'src/IRC.hs')
-rw-r--r-- | src/IRC.hs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -66,4 +66,10 @@ privmsgFromPlugin message = do Right r -> Just $ map (\r -> IRC.send $ IRC.Privmsg (channel message) (Right r) ) - (T.lines r) + (splitAtNewlines $ splitLongLines r) + where + -- IRC only permits 512 bytes per line. Use less to allow for protocol + -- information that gets sent in addition to the message content. + splitLongLines txt = T.chunksOf 400 txt + + splitAtNewlines lst = foldr (\s acc -> (T.lines s) ++ acc) [] lst |