lambdabot-xmpp 0.1.0.3 → 0.1.0.4
raw patch · 3 files changed
+14/−7 lines, 3 files
Files
- Main.hs +8/−3
- XMPP.hs +4/−2
- lambdabot-xmpp.cabal +2/−2
Main.hs view
@@ -67,6 +67,11 @@ exitWith (if isErr then ExitFailure 1 else ExitSuccess) +commonConfig =+ [ lbVersion ==> P.version+ , textWidth ==> 4096+ ]+ -- do argument handling main :: IO () main = do@@ -75,12 +80,12 @@ config' <- sequence config dir <- P.getDataDir exitWith <=< lambdabotMain modulesInfo $- [dataDir ==> dir, lbVersion ==> P.version] ++ config'+ (dataDir ==> dir) : commonConfig ++ config' -- special online target for ghci use online :: [String] -> IO () online strs = do dir <- P.getDataDir- void $ lambdabotMain modulesInfo- [dataDir ==> dir, lbVersion ==> P.version, onStartupCmds ==> strs]+ void $ lambdabotMain modulesInfo $+ (dataDir ==> dir) : commonConfig
XMPP.hs view
@@ -91,6 +91,8 @@ True -> T.replace "ACTION" "/me" m False -> T.stripStart m +joinMessages = T.intercalate (T.singleton '\n')+ readTimeout :: Chan T.Text -> Int -> IO T.Text readTimeout chan time = do result <- timeout time $ readChan chan@@ -98,14 +100,14 @@ Nothing -> return T.empty Just text -> do next <- readTimeout chan time- return $ T.concat [text, next]+ return $ joinMessages [text, next] consolidate :: Session -> XMPPConfig -> Chan T.Text -> XMPP () consolidate sess xmppconf chan = io $ forever $ do first <- readChan chan others <- readTimeout chan 50000 let name = Name "body" (Just "jabber:client") Nothing- node = NodeContent (ContentText $ T.concat [first, others])+ node = NodeContent (ContentText $ joinMessages [first, others]) let payload = Element name [] [node] let m = Message{ messageFrom = Nothing
lambdabot-xmpp.cabal view
@@ -1,5 +1,5 @@ name: lambdabot-xmpp-version: 0.1.0.3+version: 0.1.0.4 synopsis: Lambdabot plugin for XMPP (Jabber) protocol description: Usage: cabal build && .\/dist\/build\/lambdabot\/lambdabot -e 'xmpp-connect asdfasdf example.com 5222 username nick password haskell@conference.example.com' license: OtherLicense@@ -18,7 +18,7 @@ Source-repository this type: git location: https://github.com/l29ah/lambdabot-xmpp- tag: 0.1.0.3+ tag: 0.1.0.4 executable lambdabot-xmpp main-is: Main.hs