equal
deleted
inserted
replaced
311 |
311 |
312 handleCmd_inRoom ["ROOM_NAME", newName] = roomAdminOnly $ do |
312 handleCmd_inRoom ["ROOM_NAME", newName] = roomAdminOnly $ do |
313 cl <- thisClient |
313 cl <- thisClient |
314 rs <- allRoomInfos |
314 rs <- allRoomInfos |
315 rm <- thisRoom |
315 rm <- thisRoom |
316 chans <- sameProtoChans |
316 chansProto <- allChansProto |
|
317 let thisRoomNameByProto = roomNameByProto (name rm) (roomProto rm) |
317 |
318 |
318 return $ |
319 return $ |
319 if illegalName newName then |
320 if illegalName newName then |
320 [Warning $ loc "Illegal room name! The room name must be between 1-40 characters long, must not have a trailing or leading space and must not have any of these characters: $()*+?[]^{|}"] |
321 [Warning $ loc "Illegal room name! The room name must be between 1-40 characters long, must not have a trailing or leading space and must not have any of these characters: $()*+?[]^{|}"] |
321 else |
322 else |
324 else |
325 else |
325 if isJust $ find (\r -> newName == name r) rs then |
326 if isJust $ find (\r -> newName == name r) rs then |
326 [Warning $ loc "A room with the same name already exists."] |
327 [Warning $ loc "A room with the same name already exists."] |
327 else |
328 else |
328 [ModifyRoom roomUpdate, |
329 [ModifyRoom roomUpdate, |
329 AnswerClients chans ("ROOM" : "UPD" : name rm : roomInfo (clientProto cl) (nick cl) (roomUpdate rm)), |
330 AnswerClientsByProto chansProto (\p -> "ROOM" : "UPD" : thisRoomNameByProto p : roomInfo p (nick cl) (roomUpdate rm)), |
330 RegisterEvent RoomNameUpdate] |
331 RegisterEvent RoomNameUpdate] |
331 where |
332 where |
332 roomUpdate r = r{name = newName} |
333 roomUpdate r = r{name = newName} |
333 |
334 |
334 |
335 |