equal
deleted
inserted
replaced
40 |
40 |
41 |
41 |
42 sendAnswers [] _ clients _ = return clients |
42 sendAnswers [] _ clients _ = return clients |
43 sendAnswers ((handlesFunc, answer):answers) client clients rooms = do |
43 sendAnswers ((handlesFunc, answer):answers) client clients rooms = do |
44 let recipients = handlesFunc client clients rooms |
44 let recipients = handlesFunc client clients rooms |
45 putStrLn ("< " ++ (show answer) ++ " (" ++ (show $ length recipients) ++ " recipients)") |
45 putStrLn ("< " ++ (show answer)) |
46 |
46 |
47 clHandles' <- forM recipients $ |
47 clHandles' <- forM recipients $ |
48 \ch -> Control.Exception.handle (\e -> putStrLn (show e) >> hClose ch >> return [ch]) $ |
48 \ch -> Control.Exception.handle (\e -> putStrLn (show e) >> hClose ch >> return [ch]) $ |
49 if (not $ null answer) && (head answer == "off") then hClose ch >> return [ch] else -- probably client with exception, don't send him anything |
49 if (not $ null answer) && (head answer == "off") then hClose ch >> return [ch] else -- probably client with exception, don't send him anything |
50 do |
50 do |