1 module HWProtoInRoomState where |
1 module HWProtoInRoomState where |
2 |
2 |
3 import qualified Data.Foldable as Foldable |
3 import qualified Data.Foldable as Foldable |
4 import qualified Data.IntMap as IntMap |
|
5 import qualified Data.Map as Map |
4 import qualified Data.Map as Map |
6 import Data.Sequence(Seq, (|>), (><), fromList, empty) |
5 import Data.Sequence(Seq, (|>), (><), fromList, empty) |
7 import Data.List |
6 import Data.List |
8 import Maybe |
7 import Maybe |
9 -------------------------------------- |
8 -------------------------------------- |
10 import CoreTypes |
9 import CoreTypes |
11 import Actions |
10 import Actions |
12 import Utils |
11 import Utils |
|
12 import HandlerUtils |
13 |
13 |
14 |
14 |
15 handleCmd_inRoom :: CmdHandler |
15 handleCmd_inRoom :: CmdHandler |
16 |
16 |
17 handleCmd_inRoom clID clients _ ["CHAT", msg] = |
17 handleCmd_inRoom ["CHAT", msg] = do |
18 [AnswerOthersInRoom ["CHAT", clientNick, msg]] |
18 n <- clientNick |
19 where |
19 s <- roomOthersChans |
20 clientNick = nick $ clients IntMap.! clID |
20 return [AnswerClients s ["CHAT", n, msg]] |
21 |
21 |
|
22 {- |
22 handleCmd_inRoom clID clients rooms ["PART"] = |
23 handleCmd_inRoom clID clients rooms ["PART"] = |
23 [RoomRemoveThisClient "part"] |
24 [RoomRemoveThisClient "part"] |
24 where |
25 where |
25 client = clients IntMap.! clID |
26 client = clients IntMap.! clID |
26 |
27 |