author | unc0rr |
Wed, 30 Apr 2008 20:18:30 +0000 | |
changeset 892 | dfe97199f17e |
parent 891 | 701f86df9b4c |
child 893 | 149244d86bf1 |
permissions | -rw-r--r-- |
890 | 1 |
module HWProto where |
2 |
||
3 |
import IO |
|
4 |
import Miscutils |
|
5 |
||
892
dfe97199f17e
Better QUIT handling imlementation - reduces function return values count
unc0rr
parents:
891
diff
changeset
|
6 |
handleCmd :: ClientInfo -> [ClientInfo] -> [RoomInfo] -> [String] -> ([ClientInfo], [String]) |
891
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
7 |
|
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
8 |
handleCmd client clients _ ("QUIT":xs) = |
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
9 |
if null (room client) then |
892
dfe97199f17e
Better QUIT handling imlementation - reduces function return values count
unc0rr
parents:
891
diff
changeset
|
10 |
([client], ["QUIT"]) |
891
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
11 |
else |
892
dfe97199f17e
Better QUIT handling imlementation - reduces function return values count
unc0rr
parents:
891
diff
changeset
|
12 |
(clients, ["QUIT", nick client]) |
891
701f86df9b4c
Properly handle QUIT command. Now, we can concentrate on protocol implementation
unc0rr
parents:
890
diff
changeset
|
13 |
|
892
dfe97199f17e
Better QUIT handling imlementation - reduces function return values count
unc0rr
parents:
891
diff
changeset
|
14 |
handleCmd client _ _ _ = ([client], ["Bad command"]) |