equal
deleted
inserted
replaced
23 handleCmd ("QUIT" : xs) = return [ByeClient msg] |
23 handleCmd ("QUIT" : xs) = return [ByeClient msg] |
24 where |
24 where |
25 msg = if not $ null xs then head xs else "" |
25 msg = if not $ null xs then head xs else "" |
26 |
26 |
27 {- |
27 {- |
28 handleCmd clID clients _ ["PONG"] = |
28 handleCmd ["PONG"] = |
29 if pingsQueue client == 0 then |
29 if pingsQueue client == 0 then |
30 [ProtocolError "Protocol violation"] |
30 [ProtocolError "Protocol violation"] |
31 else |
31 else |
32 [ModifyClient (\cl -> cl{pingsQueue = pingsQueue cl - 1})] |
32 [ModifyClient (\cl -> cl{pingsQueue = pingsQueue cl - 1})] |
33 where |
33 where |
35 -} |
35 -} |
36 |
36 |
37 handleCmd cmd = do |
37 handleCmd cmd = do |
38 (ci, irnc) <- ask |
38 (ci, irnc) <- ask |
39 if logonPassed (irnc `client` ci) then |
39 if logonPassed (irnc `client` ci) then |
|
40 handleCmd_loggedin cmd |
|
41 else |
40 handleCmd_NotEntered cmd |
42 handleCmd_NotEntered cmd |
41 else |
|
42 handleCmd_loggedin cmd |
|
43 |
43 |
44 {- |
44 {- |
45 handleCmd_loggedin clID clients rooms ["INFO", asknick] = |
45 handleCmd_loggedin clID clients rooms ["INFO", asknick] = |
46 if noSuchClient then |
46 if noSuchClient then |
47 [] |
47 [] |