equal
deleted
inserted
replaced
42 |
42 |
43 clients' <- forM recipients $ |
43 clients' <- forM recipients $ |
44 \ci -> do |
44 \ci -> do |
45 forM_ strs (\str -> hPutStrLn (handle ci) str) |
45 forM_ strs (\str -> hPutStrLn (handle ci) str) |
46 hFlush (handle ci) |
46 hFlush (handle ci) |
47 return [] |
47 if (not $ null strs) && (head strs == "ROOMABANDONED") then hClose (handle ci) >> return [ci] else return [] |
48 `catch` const (hClose (handle ci) >> return [ci]) |
48 `catch` const (hClose (handle ci) >> return [ci]) |
49 |
49 |
50 client' <- if (not $ null strs) && (head strs == "QUIT") then hClose (handle client) >> return [client] else return [] |
50 client' <- if (not $ null strs) && (head strs == "QUIT") then hClose (handle client) >> return [client] else return [] |
51 |
51 |
52 mainLoop servSock acceptChan (remove (remove (mclient : filter (\cl -> handle cl /= handle client) clients) (concat clients')) client') mrooms |
52 mainLoop servSock acceptChan (remove (remove (mclient : filter (\cl -> handle cl /= handle client) clients) (concat clients')) client') mrooms |