equal
deleted
inserted
replaced
1 module HWProto where |
1 module HWProto where |
2 |
2 |
3 import IO |
3 import IO |
4 import Miscutils |
4 import Miscutils |
5 |
5 |
6 handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> String -> (Bool, Bool, [String]) |
6 handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> (Bool, [ClientInfo], [String]) |
7 handleCmd _ _ _ ('Q':'U':'I':'T':xs) = (True, False, []) |
7 |
|
8 handleCmd client clients _ ("QUIT":xs) = |
|
9 if null (room client) then |
|
10 (True, [client], ["QUIT"]) |
|
11 else |
|
12 (True, clients, ["QUIT " ++ nick client]) |
|
13 |
|
14 handleCmd client _ _ _ = (False, [client], ["Bad command"]) |